.update( )

Re-renders an existing cedar chart. Typically used after changing the dataset.query or specification.template properties. If the dataset is specified as a Url, the data will be re-fetched.

chart.update( )

Example Code

<div id='chartDiv'></div>

<script>
var dataset = {
    "url":"https://services.arcgis.com/uDTUpUPbk8X8mXwl/arcgis/rest/services/Public_Schools_in_Onondaga_County/FeatureServer/0",
    "mappings":{
      "group": {"field":"District","label":"District"},
      "count": {"field":"Number_of","label":"Student Number_of"}
    }
  };

var chart = new Cedar({"specification":"../../../cedar/data/templates/bar.json", "dataset": dataset});

//create and render a chart
chart.show({
  'elementId': '#chartDiv'
});
//some user action that sets the zip code... and thus updates the where clause on the query
chart.dataset.query.where = "Zip = 20007";

//update the chart
chart.update();

</script>

Edit this page on GitHub