Home › forums › Using CanvasJS › Multiple Charts with data from MySQL
This topic contains 3 replies, has 2 voices, and was last updated by Vishwas R 5 months, 3 weeks ago.
I am currently struggling to get your awesome charts together on one site.
You can find my code @ https://jsfiddle.net/vb03x8r4/ as you wished.
The JSON i got from the .php is located at the HTML part.
How can i manage to get two charts with two different JSON´s from two different .php´s on one page?
Thank you a lot for your help and your work!
Please take a look at this jsfiddle which shows rendering multiple charts rendered from multiple JSON files within a page.
Thank you, this helped me a lot.
Today i come with another question regarding your awesome charts.
Please have a look at https://jsfiddle.net/x10Lncup/ and tell me, why the chart doesn´t draw the line? In original, the data comes out of a database and is pushed into an array which i give to the datapoints:
dataPoints: <?php echo json_encode($humi, JSON_NUMERIC_CHECK); ?>
The values seems to be recognized by the chart, the numbers at the yAxis are already in place.
Thank you for your help.
Datapoint x-value can either be numeric or date object, but you seems to be passing string – which is not supported. Either changing it to date-object or passing it as label should work fine in your case. Please take a look at this updated JSFiddle.
You must be logged in to reply to this topic.