# Can I set arbitrary values for the minimum and maximum scale of the value axis?

Martynas Majeris -

Yes and no.

You can use valueAxis.minimum and maximum properties to set starting and ending value for your value axis.

However, those are just "suggestions". The chart will always struggle to adjust the scale of the value axis so that it displays "pretty" starting and ending values, as well as nice intermediate steps.

So if you set, say, the scale from 16 to 86. The chart most probably decide to go with the 10 and 90 instead.

Is there something I can do about it?

In a way, yes. You can increase the granularity of your value axis (by increasing its gridCount), so there are more steps and therefore smaller values can be used for start and end. Considering the above example you may do the following:

```var valueAxis = new AmCharts.ValueAxis();
valueAxis.autoGridCount = false;
valueAxis.gridCount = 50;
valueAxis.labelFrequency = 10; // since we increased the number of grid lines dramatically, let's make the label display only on each 10th of them```
0 out of 1 found this helpful
Have more questions? Submit a request

• Nikolay Golub

It doesn't work for me. I just that values starts from 0.

I have this code:

var valuesAxis = new AmCharts.ValueAxis();

valuesAxis.axisColor = "#2d66bb";

valuesAxis.autoGridCount = false;

valuesAxis.integersOnly = false;

valuesAxis.gridCount = 100;

valuesAxis.minimum = 0;

valuesAxis.labelFrequency = 10;

Values are between 1 and 3.5. But amcharts ignores these options.

• Maciej Jaros

You nee to add the axis to the chart like so:

var valueAxis = new AmCharts.ValueAxis();

valueAxis.minimum = 0;

Full code:

/**

* Bar chart.

*

* @param {Array} chartData [{title:"...", value:123}, ...]

* @param {String} containerId Container for the chart.

*/

this.bar = function(chartData, containerId) {

// SERIAL CHART

var chart = new AmCharts.AmSerialChart();

chart.pathToImages = "js/charts/amcharts/images/";

chart.dataProvider = chartData;

chart.categoryField = "title";

chart.colorField = "color";

chart.startDuration = 0;

chart.rotate = true;

// value-axis

var valueAxis = new AmCharts.ValueAxis();

valueAxis.minimum = 0;

// column graph

var graph = new AmCharts.AmGraph();

graph.type = "column";

graph.title = "";

graph.valueField = "value";

graph.lineColor = colorScheme.start;

graph.lineAlpha = 0;

graph.fillAlphas = 0.85;

• 