|
$("#container").ejChart( { series: [{ // here binding the data to data source dataSource: dataManger, xName: "xValue", yName: "yValue", query: query }], });
function addData() { var chart = $('#container').ejChart('instance'); var data = [ {xValue: 4, yValue: 30}, {xValue: 5, yValue: 40}, {xValue: 6, yValue: 35}, {xValue: 7, yValue: 25 }, {xValue: 8, yValue: 60 }, {xValue: 9, yValue: 38 }, {xValue: 10, yValue: 40} ];
// here bind the new data in series data source chart.model.series[0].dataSource = data; chart.redraw(); count++; } |
|
S.No |
Query |
Response |
|
1. |
Should the data be assigned to that series-points or series-datasource? |
When the chart is initialized through dataSource, we have to refresh the data through series.dataSource only, else you can assign it to series.points.
|
|
2. |
Is the data format I defined correct? |
We have to assign simple JSON data(List Collection) to series.points or series.dataSource property. If it is bind to dataSource in series, we have to map the fields in the list to the xName and yName property. |