lacroixca
Posts: 10
Joined: Wed May 04, 2011 6:48 pm

y-Axis Scaling: Precise min and max values

I ran into this issue a while ago, and simply cannot get past it. For my dynamically created charts (using PHP), i wanted to define exactly the min and max for my chart, with a precise interval between each y-axis grid. This is apparently impossible, after all I've tried. However, thanks to the wonderful support we get on this forum, I figured I would easily find a solution to this.

What I mean exactly...

http://jsfiddle.net/lacroixca/NRJEN/

I want my min & max grids to be exactly the value I've attributed them, not the closest multiple of the tickInterval variable (in this example, 39). This issue makes it very difficult to control the appearance/scaling of the chart.

Y-axis values should be:
220-
181-
142-
103-
64-
25-

Rather than:
234-
195-
156-
117-
78-
39-

Code: Select all

    yAxis: {
        startOnTick: false,
        showFirstLabel: false,
        max: 220,
        min: 25,
        tickInterval: 39,
    },
Thank you for all your help,

CAL
jlbriggs
Posts: 1465
Joined: Tue Sep 21, 2010 2:33 pm

Re: y-Axis Scaling: Precise min and max values

If you set endOnTick:false you will avoid the top yAxis label, and see only the range of min - max that you want...but it will not display the axis labels or the grid lines the way that you want them.
It could be worked around by disabling the grid lines and axis labels, calculating their values yourself, and using plotLines and their labels to substitute.

I asked the same thing here: http://highslide.com/forum/viewtopic.php?f=9&t=7904
and no solution was offered other than hacking the source code.

It seems like a very good feature to have.
I have added a feature request here: http://highcharts.uservoice.com/forums/ ... properties
Feel free to add your vote and/or comment to it.
fiddles: http://jsfiddle.net/jlbriggs/J9JLr/
lacroixca
Posts: 10
Joined: Wed May 04, 2011 6:48 pm

Re: y-Axis Scaling: Precise min and max values

Yes, I've added my votes to this suggested feature.
Thank you jlbriggs for your answer.

Now, is there a HC programmer that can confirm to me that such feature has not yet been made possible? :(
hfrntt
Posts: 6393
Joined: Mon Aug 30, 2010 8:41 am
Contact: Website

Re: y-Axis Scaling: Precise min and max values

Hi, I don't think that it's possible to do now without source code hacks.
Slawek Kolodziej
Highcharts support team

Return to “Highcharts Usage”