OData Service

To bind the Chart to data provided by an OData service, use the ODataStore.

JavaScript
$(function() {
    $("#chartContainer").dxChart({
        dataSource: new DevExpress.data.DataSource({
            store: {
                type: 'odata',
                url: 'https://js.devexpress.com/Demos/WidgetsGallery/odata/WeatherItems',
                key: 'Id'
            },
            paginate: false
        }),
        commonSeriesSettings: {
            argumentField: 'Name',
            type: 'bar'
        },
        series: [
            { valueField: 'RecordHigh', name: 'Highest temperature, °C' },
            { valueField: 'RecordLow', name: 'Lowest temperature, °C' },
            { valueField: 'Average', name: 'Average temperature, °C' }
        ]
    });
});

As you may notice, in the previous code, the ODataStore is not declared explicilty. Instead, it is wrapped in the DataSource instance. That is because the Chart requires pagination to be off in order to prevent data from partitioning. Other than that, the DataSource provides wide data-processing capabilities. For example, it can filter data.

JavaScript
$(function() {
    $("#chartContainer").dxChart({
        dataSource: new DevExpress.data.DataSource({
            store: {
                type: 'odata',
                url: 'https://js.devexpress.com/Demos/WidgetsGallery/odata/WeatherItems',
                key: 'Id'
            },
            paginate: false,
            // Takes the summer months only
            filter: [
                ['Id', '>=', 6],
                ['Id', '<=', 8]
            ]
        }),
        // ...
        // See the previous code for the series configuration
    });
});

View Demo

See Also