chart.setProperty()

Method Definition: setProperty (String propertyName, Any value)
Parent: Chart
Description: setProperty() function used to update or set any one property value at runtime

setProperty() function used to update or set any one property of Chart at runtime. If you need to update many properties of chart then use update() function

chart.render() must be called to initiate the drawing of the Chart after setting data using setProperty() function.

Function Parameters/Arguments
propertyName
- Name of the property to update
value
- property value to update

Pseudo code
                      var chart = new Cosfire.Chart("chart-container", {....});

// Set Data nothing but setting one or more DataSeries having DataPoints in each DataSeries
chart.setDate([...]);

chart.render(function onRenderCompleted() {
  // Once the chart rendered you can update the chart farther

  // Update only one property at once. If you need to update many properties of chart then use update() function
  chart.setProperty('propertyName', value);

  // Now call render again to redraw the chart
  chart.render();
}));                 
                  
Let us checkout the example below. Here in the example there is only one DataSeries of type "Bar" and there are 6 DataPoints in it. DataPoints are set through points property of DataSeries. We add more than one DataSeries to create multi-series Chart very easily.