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

Line graph time issue

Open Gaz492 opened this issue 10 years ago • 2 comments

Im having an issue with using the time scale type. I want the graph to start at the very start of the graph and end at the very end but i get something that looks like this https://jsfiddle.net/13zy7ykt/4/

Gaz492 avatar Aug 07 '16 21:08 Gaz492

Hi gaz492

You will need to supply labels (of time) that correspond to each of your data points.

eg:

        //labels: [1470525209000,1470528809000],
        labels: ['01:00','02:00','03:00','04:00','05:00','06:00','07:00'],

https://jsfiddle.net/13zy7ykt/5/

Note that time.format is the format of your "input" labels and displayFormat is the "output" or the actual labels.

rory-austin avatar Aug 08 '16 11:08 rory-austin

Another option is to use the time.min and time.max settings to get exact start and end points for the x axis.

etimberg avatar Aug 22 '16 01:08 etimberg