1
votes

I am trying to plot the highchart with min,max limit and tickAmount. But when it plots the min and max values are not setting properly, instead the tick intervals are divided and some min/max values are set by highchart.

<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>

<div  id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>

Example : http://jsfiddle.net/s2erv69n/

My requirements

Values can be positive or negative. 

Y axis should start at a certain value (the bottom of the axis):

Find the lowest value of all the 10 years and then round down the value to the nearest 1% (ex. -4.3% should be -5.0%).

This lowest value should be the starting point (bottom) of the Y axis (the first ticker of the Y axis).

Y axis should end at a certain value (the top of the axis): Find the highest value of all the 10 years and then round up the value to the nearest 1% (ex. 12.5% should be 13.0%).

This highest value should be the end point (top) of the Y axis (the last ticker of the Y axis).

There should always be 6 tickers (5 intervals) on the Y axis.

Clarifications

  • Based on above requirements, the example has created and min/max values are defined for both primary and secondary axis.

  • In this case the range is -1 to 17 Why its plotted between -8 to 32

  • For the positive values its fine whereas negative values min/max is placed wrong in the axis

  • Whether highchart will support dynamic min/max with tickAmount or not.

Please suggest me how to get the requirements done.

1

1 Answers

1
votes

Add tickPositions in primary Yaxis and secondary Yaxis instead of tickAmount.

For Example : http://jsfiddle.net/g21uyyjs/