Sunday, 27 October 2019

ChartJS - Finding the minimum and maximum labels that are inside a pan (When zooming)

I have a chart like this:

pan

Now I need to find the minimum and maximum labels that are inside a pan, when I zoom, for example:

pan complete

The minimum would be 2018-07-16, and the maximum would be 2018-11-3.

For panning, I'm using this attribute:

pan: {
    enabled: true,
    mode: 'x',
    onPanComplete: function(e) {
        console.log(e)
    }
}

If I look at the returned object, I see a lot of information about this pan. But I can't find relevant information to conclude these extremum labels.

I thought the attribute chartArea would be sufficient, but its value doesn't differ for two very different pans. Same goes for config, boxes, and a lot of other attributes.

How can I find these extremum labels?



from ChartJS - Finding the minimum and maximum labels that are inside a pan (When zooming)

No comments:

Post a Comment