Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Year Line Graph

Open jbhorsewriter7 opened this issue 10 years ago • 1 comments

Is there any way to create a line graph with data points for every day in a year - but only display the month titles?

jbhorsewriter7 avatar Feb 09 '16 17:02 jbhorsewriter7

@jbhorsewriter7 you can do this in v2 using the new time scale. Some time scale samples are available at: https://github.com/nnnick/Chart.js/tree/v2.0-dev/samples/timeScale

V2 documentation is available at http://nnnick.github.io/Chart.js/docs-v2/

In your config you'd probably want

scales: {
    xAxes: [{
        time: {
            unit: 'month'
        }
    }]
}

etimberg avatar Feb 09 '16 18:02 etimberg