All docs
V19.1
24.1
The page you are viewing does not exist in version 24.1.
23.2
The page you are viewing does not exist in version 23.2.
23.1
The page you are viewing does not exist in version 23.1.
22.2
The page you are viewing does not exist in version 22.2.
22.1
The page you are viewing does not exist in version 22.1.
21.2
The page you are viewing does not exist in version 21.2.
21.1
The page you are viewing does not exist in version 21.1.
20.2
The page you are viewing does not exist in version 20.2.
20.1
The page you are viewing does not exist in version 20.1.
19.2
19.1
18.2
18.1
17.2
A newer version of this page is available. Switch to the current version.

DevExtreme jQuery - Configure a Widget

The following code example shows how to declare a widget configuration object using TypeScript.

window.onload = () => {
    var options: DevExpress.viz.charts.dxChartOptions;
    options = {
        dataSource: [
            { fruit: 'Oranges', total: 10 },
            { fruit: 'Apples', total: 15 },
            { fruit: 'Bananas', total: 9 }
        ],
        series: { argumentField: 'fruit', valueField: 'total' }
    };  
};

Any configuration object should have a specific type. In this example, the options object has the dxChartOptions type, which configures the Chart widget. Type names are formed by concatenating the widget name (in this example, dxChart) and Options.

The part that preceeds the type is its namespace. DevExtreme widgets are declared in the following namespaces.

After you have declared a configuration object, pass it to the jQuery plugin ...

$("#chartContainer").dxChart(options);  

... Knockout binding ...

var viewModel = {
    chartOptions: options
};

ko.applyBindings(viewModel);
HTML
<div data-bind="dxChart: chartOptions"></div>

... or AngularJS directive.

function Controller($scope) {
    $scope.chartOptions = options;
}
HTML
<div ng-controller="Controller">
    <div dx-chart="chartOptions"></div>
</div>
NOTE
TypeScript is only for declaring a widget configuration. You still need to use jQuery, Knockout or AngularJS to apply this configuration.
See Also