chartjs-adapter-moment icon indicating copy to clipboard operation
chartjs-adapter-moment copied to clipboard

No examples on how to use this adapter with 3.0.0-beta.3

Open esttenorio opened this issue 3 years ago • 3 comments

There seems to be no documentation or examples on how to use this adapter with the latest charjs version.

esttenorio avatar Mar 04 '21 03:03 esttenorio

There's a sample in the main chartjs repo. https://github.com/chartjs/Chart.js/blob/master/samples/scales/time/line.html

etimberg avatar Mar 04 '21 03:03 etimberg

I'm trying to replicate this scenario below using 3.x.x since I need to use some specific plugins that need 3.x.x:

This example is using chartjs 2.7 https://stackoverflow.com/a/48143738/223851

The example in StackOverflow does not make use of labels as the example you pointed out, the labels are generated automatically. Using the example you shared, the behavior that I see is that the labels bypass any value of x passed in the Datapoint {x,y}.

Here's an example I built: https://codepen.io/esttenorio/pen/OJbwmrL

Is the behavior shown on the Stackoverflow example supported in 3.x.x? Or am I missing some config?

I've tried instead of using x as a string, passing Date or Moment instead but none of them seems to work.

esttenorio avatar Mar 04 '21 19:03 esttenorio

It should work just fine with x/y data https://codepen.io/etimberg/pen/LYbgPmj

etimberg avatar Mar 08 '21 00:03 etimberg