The data in the chart.js that I'm currently migrating is an Array of Hashes such as data: [{ x: '2019-03-05', y: 6.2 },{ x: '2019-04-01', y: 6.2 },..]. I know that this data format is possible because I'm currently using the chartjs-adapter-date-fns. Since the example in the docs is just an Array of Integers data: [37, 83, 78, 54, 12, 5, 99], is that the only format that is supported? Event if I use the chartjs-adapter-date-fns library with stimulus-chartjs it doesn't seem to take effect. This is what I get:
It would be extremely helpful if this library was able to play nicely with chartjs-adapter-date-fns by default would that be possible? or does that logic belong in a different library?
currently in the process of migrating my chart.js to use the Stimulus controller. The code before the migration is the following:
Which looks like:
The data in the chart.js that I'm currently migrating is an Array of Hashes such as
data: [{ x: '2019-03-05', y: 6.2 },{ x: '2019-04-01', y: 6.2 },..]
. I know that this data format is possible because I'm currently using thechartjs-adapter-date-fns
. Since the example in the docs is just an Array of Integersdata: [37, 83, 78, 54, 12, 5, 99]
, is that the only format that is supported? Event if I use thechartjs-adapter-date-fns
library withstimulus-chartjs
it doesn't seem to take effect. This is what I get:app/javascript/controllers/index.js
:app/controllers/charts_controller.rb
:app/views/charts/show.html.erb
:It would be extremely helpful if this library was able to play nicely with
chartjs-adapter-date-fns
by default would that be possible? or does that logic belong in a different library?