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.

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top