Essential Chart supports remote data binding that is binding data in the server with chart, using Essential DataManager. Refer Data Manager for information about using Essential DataManager for JavaScript. The data manager object should be assigned to the dataSource property of series. The properties xName and yName of the series should be assigned to the fields in data source representing the x and y values of the series respectively. The query property of the series should be assigned to a query object for querying the data returned by the data manager. The following code example demonstrates binding Chart to oData service. JS <script type="text/javascript"> $(function () { //Assigning URL to data manager var dataManger = new ej.DataManager({ url: "http://mvc.syncfusion.com/Services/Northwnd.svc/" }); // Object to query the data retrieved by data manager var query = ej.Query().from("Orders").take(6); $("#container").ejChart({ series: [{ //Assigning data manager as data source to chart dataSource: dataManger, xName: "ShipCity", yName: "Freight", query: query , }], }); }); </script> Screenshot The output for the above code example binding chart with oData service is as follows: Figure 1: Output JS Playground sample link: Remote data |
This page will automatically be redirected to the sign-in page in 10 seconds.