Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

Is it possible to skip labels in a line chart if i have a large amount of data in react-chartjs1.2.0 #215

Open
balgopal14 opened this issue Mar 30, 2018 · 1 comment

Comments

@balgopal14
Copy link

I have over 500 data points to show in a line chart. But there is not enought space to show a label for each data point. The labels are sorted dates on x-axes and price on y-axes . so I need a option that defines to show only each 4th, 5th, ... label on the x-axis. But for each data point the tooltip should show the correct and full label and value.

@jrutz
Copy link

jrutz commented Dec 4, 2018

I also ran into this issue. It doesn't seem to be supported in this particular version of chartJs. The workaround I found for displaying a minimal number of ticks was to do a mod on the label array (not sure what the resolution would be for the tooltips)

for(var i = 0; i < labels.length; i ++ ) {
    if(i % 5 === 0) {
        labels.push(dateString);
    } else {
         labels.push('');
    }
} 

Would still love to see support of the autoSkip option in the future

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants