Chart

The Chart is a widget that visualizes data from a local or remote storage using a great variety of series types along with different interactive elements, such as tooltips, crosshair pointer, legend, etc.

Included in: dx.viz.js, dx.viz-web.js, dx.all.js
Module: viz/chart
Chart interactive configuration
Copy Code
Copy to Codepen
$("#chart").dxChart({
});

You can create the Chart widget using one of the following approaches.

  • jQuery
    Use the dxChart jQuery plug-in.

    HTML
    <div id="chartContainer"></div>
    JavaScript
    $("#chartContainer").dxChart({
        dataSource: dataSource,
        commonSeriesSettings: {
            argumentField: "state",
            type: "bar"
        },
        series: [
            { valueField: "year2004", name: "2004" },
            { valueField: "year2001", name: "2001" },
            { valueField: "year1998", name: "1998" }
        ]
    });
  • Knockout
    Add a <div> element and apply the dxChart binding to this element.

    HTML
    <div data-bind="dxChart: {
        dataSource: dataSource,
        commonSeriesSettings: {
            argumentField: 'state',
            type: 'bar'
        },
        series: [
            { valueField: 'year2004', name: '2004' },
            { valueField: 'year2001', name: '2001' },
            { valueField: 'year1998', name: '1998' }
        ]
    }"></div>
  • AngularJS
    Add a <div> element and apply the dx-chart directive to this element.

    HTML
    <div dx-chart="{
        dataSource: dataSource,
        commonSeriesSettings: {
            argumentField: 'state',
            type: 'bar'
        },
        series: [
            { valueField: 'year2004', name: '2004' },
            { valueField: 'year2001', name: '2001' },
            { valueField: 'year1998', name: '1998' }
        ]
    }"></div>

All DevExtreme widgets require linking the jQuery library. Linking the Knockout or AngularJS library is optional. For detailed information on how to link the needed libraries, refer to the Installation article.

Start Tutorial View Demo

See Also
  • Data Binding - shows how to provide data for the Chart widget.
  • Chart Elements - provides an overview of visual elements present in the Chart widget.

Configuration

This section describes properties that configure the contents, behavior and appearance of the Chart widget.

Methods

This section describes the methods that can be used in code to manipulate the Chart widget.

Use the dxChart registered method to access the Chart widget as demonstrated in the code below.

JavaScript
var chart = $("#chartContainer").dxChart("instance");

Events

This section describes events fired by this widget.

Series Types

This section lists objects that define options used to configure series of specific types.

Chart Elements

This section lists the methods and fields of chart elements.