Question

I am using the Highcharts js library and in particular the Highstock Timeseries chart, like this one: http://www.highcharts.com/stock/demo/.

Do you know how can I get after an event what is the current navigator's selection? E.g. let's say we visualize data from the 25th of June till the 27th of June, whereas the whole visualization includes data from the 1st of June till the 30th of June, is there a way to retrieve the values showing the selection: 25th-27th?

Please let me know if I didn't make myself clear.

Était-ce utile?

La solution

According to highcharts API reference:

events: {
    selection: function(event) {
        console.log(
            Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', event.xAxis[0].min),
            Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', event.xAxis[0].max)
        );
    }
}

demo

reference

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top