I'm wondering the best way to achieve this goal.
Goal: Apply a custom number format to the Axis Label Numbers.
The desired Number format is Engineering Notation. For example, suppose the axis labels are showing the numbers [2; 2,000; 2,000,000; 2,000,000,000]. In engineering format, these labels would be [2, 2k, 2M, 2G], or even [2.0, 2.0k, 2.0M, 2.0G]. Is there a format label function I can override? I do not think I can achieve this with the AxisBase.LabelsNumberFormat property.
Thanks!
Custom Axis Label Number Format
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: Custom Axis Label Number Format
LabelsNumberFormat accepts standard .net double.ToString() formatting, and this 'k', 'M', 'G', 'T', 'P' etc. isn't supported in it, AFAIK.
The engineering format has to be made with axis.FormatValueLabel event handler. In the handler, you get the actual value, and you can output the value as a string of any format.
The engineering format has to be made with axis.FormatValueLabel event handler. In the handler, you get the actual value, and you can output the value as a string of any format.
LightningChart Support Team, PT
Re: Custom Axis Label Number Format
Do you know where I can find an example of this? I'm running into the same issue. Thanks!ArctionPasi wrote:LabelsNumberFormat accepts standard .net double.ToString() formatting, and this 'k', 'M', 'G', 'T', 'P' etc. isn't supported in it, AFAIK.
The engineering format has to be made with axis.FormatValueLabel event handler. In the handler, you get the actual value, and you can output the value as a string of any format.
Re: Custom Axis Label Number Format
In our demo application, for example "Business dashboard" (under "Dashboards") uses FormatValueLabel event. Example's class/file name is ExampleBusinessDashboard.
Other examples are ExampleAxisLabelRangeEdit and ExamplePersistentIntensitySignal.
Other examples are ExampleAxisLabelRangeEdit and ExamplePersistentIntensitySignal.