Vue PieChart - Overview

A series is a collection of related data points. The most important characteristic of a series is its type. The PieChart provides Pie and Doughnut series types; the only difference between them is the Doughnut has a blank center.

Embedded applications are not available for the selected DevExtreme version (v22.1).
We recommend that you upgrade to the most recent version of DevExtreme to access the latest features, bug fixes, and security updates.

The Pie series type is used by default, but you can change it to Doughnut using the type property.

App.vue
  • <template>
  • <DxPieChart ...
  • type="doughnut"> <!-- or "donut" -->
  • </DxPieChart>
  • </template>
  •  
  • <script>
  • import DxPieChart from 'devextreme-vue/pie-chart';
  •  
  • export default {
  • components: {
  • DxPieChart
  • }
  • }
  • </script>

Use the series property to configure a series. Pass an object to this property if you have only one series, or an array of objects when you have multiple series. In the latter case, you can also specify settings common for all series in the commonSeriesSettings object, for example:

App.vue
  • <template>
  • <DxPieChart ... >
  • <DxCommonSeriesSettings
  • argument-field="year"
  • />
  • <DxSeries value-field="men" />
  • <DxSeries value-field="women" />
  • </DxPieChart>
  • </template>
  •  
  • <script>
  • import DxPieChart, {
  • DxCommonSeriesSettings,
  • DxSeries
  • } from 'devextreme-vue/pie-chart';
  •  
  • export default {
  • components: {
  • DxPieChart,
  • DxCommonSeriesSettings,
  • DxSeries
  • }
  • }
  • </script>

Settings specified for a series apply to all its points. If you need to customize an individual point, assign a function to the customizePoint property. This function must return an object with properties for the point that you want to customize.

App.vue
  • <template>
  • <DxPieChart ...
  • :customize-point="customizePoint">
  • <DxSeries color="blue" />
  • </DxPieChart>
  • </template>
  •  
  • <script>
  • import DxPieChart, {
  • DxSeries
  • } from 'devextreme-vue/pie-chart';
  •  
  • export default {
  • components: {
  • DxPieChart,
  • DxSeries
  • },
  •  
  • methods: {
  • // All series points with the value more than 100 turn red
  • // Other series points remain blue
  • customizePoint(pointInfo) {
  • return pointInfo.value > 100 ? { color: 'red' } : { };
  • }
  • }
  • }
  • </script>

Refer to other topics in this section for details on main series features.

See Also