I'm eager to find out if its possible to place last value in series to yAxis in highcharts.
It supposed to be simple label with last point value shown on the right side of the charts, dinamically chanhing when we add points to the chart.
thanks!
I'm eager to find out if its possible to place last value in series to yAxis in highcharts.
It supposed to be simple label with last point value shown on the right side of the charts, dinamically chanhing when we add points to the chart.
thanks!
There are probably several methods. One that I would use can be seen in this example:
http://jsfiddle.net/jlbriggs/zXLZA/
This makes use of the datalabels, which are enabled only for the last data point.
The downside to this is that you need to specify that in your data. Not hard to do, but may not fit your needs.
Another way would be to use a second y axis, and the tickPositions property:
http://jsfiddle.net/jlbriggs/zXLZA/4/
we can make use of formatter for this
here is an example to display the last value http://jsfiddle.net/kgNy4/1/
here is an example to display maximum value http://jsfiddle.net/kgNy4/
In the example I have put
dataLabels: { enabled: true }
so that formatter function will be executed
I hope this will be useful for you
to get the highest value in any axis and series, use the function getExtreme(). It will find you the extreme value (highest or lowest depending of the argument you put behind). Select the chart, the axis and the series before.
here's an example: (whith your chart associated to the variable 'yourChart')
It will return the highest value of the first Y-axis' associated series.
While this below will return the lowest of the second X-axis' associated series:
Another possible solution is to use
tickPositioner
with second yAxis. In such case with dynamic data, everything will be computed itself, see: http://jsfiddle.net/3c4tU/My recommended solution: