I have a chart in AmCharts that reflects integer values; as such I want the value in the Y Axis to also be integers however they are showing up as floating point. I have read through documentation and found reference to: numberFormatter with the following syntax:
chart.numberFormatter = { precision:-1,decimalSeparator:".",thousandsSeparator:"," };
Changing the precision does not seem to have an impact. I've seen suggestions at setting it to 0 would work for removing the value after the decimal but it does not. I have also read that setting precision to -1 inhibits rounding which confuses me as to what precision is used for.
I am using AmCharts version 2.9.3. I have found that there is a bug where numberFormatter is ignored in this version (pre 2.11) when usePrefixes was set to true however that is not the case.
I have found references to a parameter called: digits_after_decimal
However the references I found were for much older versions of AmCharts and the reference was for this parameter in a config file; and I do not see a reference for this in my version.
I have done quite a bit of research and am looking for any pointers as to what I am doing wrong as I know this is simply a misunderstanding of the API. I have also been toying with a JSFiddle example from AmCharts site:
http://jsfiddle.net/amcharts/zu9nW/
On the Format tab, in the Current Selection group, click Format Selection. Under Axis Options, Click Number, and then in the Category box, select the number format that you want. Tip If the number format you select uses decimal places, you can specify them in the Decimal places box.
Setting output formatNumberFormatter uses format, set in its property numberFormat to turn a numeric value into a formatted string. "numberFormat": "#."
To "turn off" an axis, all we need to do is to set is disabled property to true . This will remove axis from display, as well as free up space occupied by it for the chart itself.
Usually refers to the vertical axis in 2D charts and graphs, which shows the values being measured or compared. Refer to it as the value (y) axis on the first mention. On subsequent mentions, use y-axis.
For amCharts v4 it will be:
valueAxis.maxPrecision = 0;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With