In the above code, we're doing the following:
- Instantiate our chart without any data and one single dataset.
- Define a custom function feedDataToChart() which gets invoked when the user clicks the Feed Random Data button.
This function builds the data (in real-time data format) to be specified to the chart. It contains random value for demo purpose.
- We finally feed the data to chart using feedData(strData) method.
When you now view this example, you'll get something as under (image taken after button was clicked a few times): |