PieChart

The PieChart is a widget that visualizes data as a circle divided into sectors that each represents a portion of the whole.

Included in: dx.viz.js, dx.viz-web.js, dx.all.js
Module: viz/pie_chart
PieChart interactive configuration
Copy Code
Copy to Codepen
$("#piechart").dxPieChart({
});

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

  • jQuery
    Use the dxPieChart jQuery plug-in.

    HTML
    <div id="chartContainer"></div>
    JavaScript
    $("#chartContainer").dxPieChart({
        dataSource: dataSource,
        series: {
            argumentField: "country",
            valueField: "area"
        }
    });
  • Knockout
    Add a div element and apply the dxPieChart binding to this element.

    HTML
    <div data-bind="dxPieChart: {
        dataSource: dataSource,
        series: {
            argumentField: 'country',
            valueField: 'area'
        }
    }"></div>
  • AngularJS
    Add a div element and apply the dx-pie-chart directive to this element.

    HTML
    <div dx-pie-chart="{
        dataSource: dataSource,
        series: {
            argumentField: 'country',
            valueField: 'area'
        }
    }"></div>

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the Installation article.

To learn more about PieChart's visual elements, refer to the PieChart Elements help article. To learn how to provide data for the PieChart widget, refer to the Data Binding article.

Start Tutorial View Demo Watch Video

See Also

Configuration

An object that defines configuration options for the PieChart widget.

Methods

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

Use the dxPieChart registered method to access the PieChart widget, as demonstrated in the code below.

var pieChart = $("#pieChartContainer").dxPieChart("instance");

Events

This section describes events fired by this widget.

Series Types

This section lists the objects that define options to be used to configure series of particular types.

Chart Elements

This section lists the methods and fields of the PieChart elements.