Search code examples
chartsdojodestroy

dojox chart update/destroy does not work after dojo.byId


I created a dojo chart using;

var pieChart = new dojox.charting.Chart2D("pieChart");

Afterwards I want to update/destroy this chart. SO I do;

var pieChart = dojo.byId("pieChart");
pieChart.destroy();

This seems to be not functional. Am I doing something wrong here?

best


Solution

  • As you're using dojox so dojo.byId will not return javascript object try using dijit.byId I think it'll work as suggested below:

    var pieChart = dijit.byId("pieChart"); pieChart.destroy();

    the same problem I was facing with dojox.form.BusyButton after a great effort I found this...