YasirPoongadan
YasirPoongadan

Reputation: 749

How change Highchart minimum value

For my highchart, I want to set maximum value of 100 and minimum value of 1.

When I try to code like this, it outputs is 0-100 not 1-100.

If I change or remove max range, it works fine for small values of y.

yAxis: {
            min:1,
            max:100,
            reversed: true,
            title: {
                text: 'Rank'
            },
            plotLines: [{
                value: 0,
                width: 1,
                color: '#808080'
            }]
},

Upvotes: 2

Views: 304

Answers (2)

SteveP
SteveP

Reputation: 19103

You can force the y-axis to have specific tick intervals using the tickPositioner function in the y-axis e.g.

        tickPositioner: function () {
            var positions = [1, 25, 50, 75, 100];
            return positions;
        }

http://jsfiddle.net/cU2md/

Upvotes: 3

Raunak Kathuria
Raunak Kathuria

Reputation: 3225

You can try

chart.yAxis[0].setExtremes(1,100);

http://api.highcharts.com/highcharts#Axis.setExtremes

If it is dynamic data/tick data you can set

startOnTick : false

This problem is discussed here also http://forum.highcharts.com/viewtopic.php?f=9&t=6862

Upvotes: 3

Related Questions