Home forums Using CanvasJS Update all charts from single onclick event

This topic contains 1 reply, has 2 voices, and was last updated by  Manoj Mohan 2 weeks, 1 day ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26636

    Using php and and and ajax call to update a MySQL query for a dashboard. This enables a user to click and pie segment and add that segment as a filter (to reduce the dataset).

    I am able to re-render the pie in question to apply that as a filter but can’t re-render the other charts. Each chart is wrapped as below in jquery function.

    $(function () {
    var chart_country = new CanvasJS.Chart("Country".....
    }); 

    The onclick event generates a warning and fails to update other charts even though I call

    chart_country.render();
    chart_cdn.render();
    chart_deviceos.render();

    Warning in console:
    jquery.min.js:2 jQuery.Deferred exception: Cannot read property ‘render’ of undefined TypeError: Cannot read property ‘render’ of undefined
    at Object.<anonymous> (http://35.177.188.40/dashboard/web-analytics-overview.php:462:11)
    at j (https://cdn.jsdelivr.net/jquery/latest/jquery.min.js:2:29999)
    at k (https://cdn.jsdelivr.net/jquery/latest/jquery.min.js:2:30313) undefined

    Any help/advice appreciated.

    • This topic was modified 2 weeks, 1 day ago by  dhalket.
    #26644

    @dhalket,

    Can you kindly create a JSFiddle reproducing the issue so that we can understand your scenario better and help you out?

    —-
    Manoj Mohan
    Team CanvasJS

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

You must be logged in to reply to this topic.