I am using amCharts to prepare bar chart
Please check the Fiddle for my bar chart as follows:
FIDDLE
What I tried to putting Maximum for Y axis as follows:
I have added this lines for handling Y axis as follows:
valueAxis.autoGridCount = false;
valueAxis.gridCount = 10;
valueAxis.labelFrequency = 100;
But not getting. Please guide me!
To set fixed scale for your value axis, use minimum
and maximum
properties:
valueAxis.minimum = 0;
valueAxis.maximum = 100;
The chart automatically tries to determine the frequency of the labels based on available space so that the axis does not seem cluttered.
To force a certain number of grid lines on a category axis, use autoGridCount
and gridCount
properties of the chart's categoryAxis
. (note that it's categoryAxis
, not valueAxis
as you have in your code)
chart.categoryAxis.autoGridCount = false;
chart.categoryAxis.gridCount = 10;
You can use value axis' unit
and unitPosition
properties to add any characters next to the values.
valueAxis.unit = "%";
valueAxis.unitPosition = "right";
Here's your fiddle updated with all of the above.
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