Home Forums Chart Support need to create chart where number of charts to be created is dynamic

need to create chart where number of charts to be created is dynamic

Viewing 4 posts - 1 through 4 (of 4 total)
  • #22729

    Hi,
    I have a situation where i have to create multiple charts dynamically.the number of charts r n and on document ready the data will be fetched from db in array or array format.and based on that data n number of charts will b created along with the div to contain the chart..
    Any help or any jsfiddle to help with that?

    #22736

    @desen17,

    Please take a look at this jsfiddle which demonstrates the dynamic creation of chart containers and rendering chart within that. Also, refer to these examples on creating a dynamic chart and rendering a chart with data from database using PHP.
    __
    Priyanka M S
    Team CanvasJS

    #22737

    Hi priyanka,
    Thanks for the help.now multiple charts r coming but one issue ,the datapoints r getting updated for each of the charts even if i explicitly want to update chart[i].I have tweaked the fiddle to replicate the issue..Please have a look into it.
    https://jsfiddle.net/u1h7vrcp/

    #22749

    @desen17,

    In the jsfiddle you have shared, after creating 5 charts you are looping through each chart and adding dataPoints(‘i’ number of dataPoints) to them, this logic updates every chart and not just one as it’s in a loop. The jsfiddle shared seems to be working fine. If you are still facing any issue with this, please brief us further about it.

    __
    Priyanka M S
    Team CanvasJS

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

You must be logged in to reply to this topic.