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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #21976

    svN

    Hi Guys!

    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!

    Kind regards,

    Sven

    #21980

    @svn,

    Please take a look at this jsfiddle which shows rendering multiple charts rendered from multiple JSON files within a page.


    Vishwas R
    Team CanvasJS

    #24522

    svN

    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:

    data: [{
    		type: "spline",
    		name: "Luftfeuchte",
    		color: "#369EAD",
    		showInLegend: true,
    		axisYIndex: 0,
    		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.

    BR,

    Sven

    #24528

    Sven,

    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.


    Vishwas R
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.