|
[Chart.aspx.cs]
AddHandler Me.ChartWebControl1.ChartFormatAxisLabel, AddressOf ChartWebControl1_ChartFormatAxisLabel
Private Sub ChartWebControl1_ChartFormatAxisLabel(ByVal sender As Object, ByVal e As ChartFormatAxisLabelEventArgs)
If e.AxisOrientation = ChartOrientation.Vertical Then
If e.Value > 999999 Then
e.Label = "£" & (e.Value) / 100000 & "M"
Else
e.Label = "£" & (e.Value) / 1000 & "K"
End If
e.Handled = True
End If
End Sub |
|
app.component.html:
<ejs-chart (axisLabelRender) = 'axisLabelRender($event)' >
<e-series-collection>
// add your additional code here
</e-series-collection>
</ejs-chart>
// add your additional code here app.component.ts: // add your additional code here public axisLabelRender(args : IAxisLabelRenderEventArgs ): void { if (args.axis.name === 'primaryYAxis') {
var value = parseInt(args.text);
if(value > 1 && value < 99999) {
args.text = (value/1000)+'K';
} else if(value > 99999) {
args.text = (value / 1000000)+ 'M';
}
}
}; |