.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>

var dataset = {
      "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
  '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


Edit this page on GitHub