Articles in this section
Category / Section

How to bind remote data to JavaScript Chart?

6 mins read

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:

Binding remote data to Chart

Figure 1: Output

JS Playground sample link: Remote data


Conclusion


I hope you enjoyed learning about how to compare JavaScript DropDownList vs Combobox vs Autocomplete vs MultiSelect.

You can refer to our JavaScript Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our JavaScript Chart example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied