Thursday, 15 September 2011

highcharts - Get next xAxis label -



highcharts - Get next xAxis label -

i utilize event-function display start , endposition of zoom event.

xaxis: { categories: ['2012-01','2012-02','2012-03'], events: { aftersetextremes: function(event){ if (this.getextremes().datamin < event.min) hcmin = this.getextremes().min; hcmax = this.getextremes().max; alert(hcmin); alert(hcmax); } } },

the function this.getextremes().min show me point of xaxis between labels. nearest label illustration '2012-02'. how get?

you can label way:

var min = math.round(event.min); var label = this.categories[min];

example: http://jsfiddle.net/j5z5e/6/

highcharts

No comments:

Post a Comment