lukbukkit / chartist-plugin-tooltip

Tooltip plugin for Chartist.js
MIT License
16 stars 13 forks source link

Data from AJAX Request #8

Closed afonsofsgomes closed 3 years ago

afonsofsgomes commented 4 years ago

Hi! I would like to know how can I insert values incoming from AJAX Request in array.

Here is the example: var chart = new Chartist.Line('.ct-chart', { labels: [1, 2, 3], series: [ [ {meta: 'description', value: value1}, ] ] }, { plugins: [ Chartist.plugins.tooltip() ] });

value1 has this values: {"hour":"23:29:26","temperature":"19.00","humidity":"71.50"}

Any idea?

lukbukkit commented 4 years ago

If I understand your intention corretly: You want to create a chart with two lines, one for the temperature, the other one for the humidity correct? It's a bit tricky to use such a timestamp for the x axis using chartist.js, but I can create a JSFiddle which shows you how to create such a chart.

afonsofsgomes commented 4 years ago

Yes, correct!

lukbukkit commented 4 years ago

Okay here's an example of creating a single combined chart or two charts by using your ajax data: https://jsfiddle.net/kf5cxp21/16/

lukbukkit commented 3 years ago

I closed this issue, because there was no recent activity. If there are any question, feel free to comment or reopen this issue.