SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components
yAxis.textFormatting = “%f”
First image file is the result of this code.
yAxis.textFormatting = “0.00000000”
Second image file is the result of this code.
First code doesn’t work, even it is just a sample code in document.
Second code works, but I want flexible trailing zeros.
How can I do?
Hello, Minsub Kim.
Thank you for your interest in SciChart.
In the first case, formatting is not fully correct. And the second case works as expected.
Let me explain, in more details:
‘textFormatting’ property is used by NSNumberFormatter object under the hood, and NSNumberFormatter – accepts format patterns based on Unicode Technical Standard #35.
So ‘0’ symbol in number format string means, that digit will be always displayed (odd zero in case if actual digit is absent). If you want flexible trailing zeros use ‘#’ symbol instead of ‘0’. For example ‘0.0##’ format will convert 2.3345 number to 12.334, and 1.2 number will be displayed as is.
Hope, this information will help.
Please login first to submit.