PieChart

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

Included in: dx.viz.js, dx.all.js
import PieChart from "devextreme/viz/pie_chart"
PieChart interactive configuration
Copy Code
Copy to Codepen
import PieChart from "devextreme/ui/pie_chart";

new PieChart(container, {
});

                    
Type:

Object

Configuration

An object that defines configuration properties for the PieChart UI component.

Name Description
adaptiveLayout

Specifies adaptive layout properties.

animation

Specifies animation properties.

annotations

Specifies the annotation collection.

centerComponent

An alias for the centerTemplate property specified in React. Accepts a custom component. Refer to Using a Custom Component for more information.

centerRender

An alias for the centerTemplate property specified in React. Accepts a rendering function. Refer to Using a Rendering Function for more information.

centerTemplate

Specifies a custom template for content in the pie's center.

commonAnnotationSettings

Specifies settings common for all annotations in the PieChart.

commonSeriesSettings

An object defining the configuration properties that are common for all series of the PieChart UI component.

customizeAnnotation

Customizes an individual annotation.

customizeLabel

Customizes the appearance of an individual point label.

customizePoint

Customizes the appearance of an individual series point.

dataSource

Binds the UI component to data.

diameter

Specifies the diameter of the pie.

disabled

Specifies whether the UI component responds to user interaction.

elementAttr

Specifies the global attributes to be attached to the UI component's container element.

export

Configures the exporting and printing features.

innerRadius

Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1.

legend

Specifies PieChart legend properties.

loadingIndicator

Configures the loading indicator.

margin

Generates space around the UI component.

minDiameter

Specifies the minimum diameter of the pie.

onDisposing

A function that is executed before the UI component is disposed of.

onDone

A function that is executed when all series are ready.

onDrawn

A function that is executed when the UI component's rendering has finished.

onExported

A function that is executed after the UI component is exported.

onExporting

A function that is executed before the UI component is exported.

onFileSaving

A function that is executed before a file with exported UI component is saved to the user's local storage.

onIncidentOccurred

A function that is executed when an error or warning occurs.

onInitialized

A function used in JavaScript frameworks to save the UI component instance.

onLegendClick

A function that is executed when a legend item is clicked or tapped.

onOptionChanged

A function that is executed after a UI component property is changed.

onPointClick

A function that is executed when a series point is clicked or tapped.

onPointHoverChanged

A function that is executed after the pointer enters or leaves a series point.

onPointSelectionChanged

A function that is executed when a series point is selected or selection is canceled.

onTooltipHidden

A function that is executed when a tooltip becomes hidden.

onTooltipShown

A function that is executed when a tooltip appears.

palette

Sets the palette to be used to colorize series and their elements.

paletteExtensionMode

Specifies what to do with colors in the palette when their number is less than the number of series (in the Chart UI component) or points in a series (in the PieChart UI component).

pathModified

Notifies the UI component that it is embedded into an HTML page that uses a tag modifying the path.

pointSelectionMode

Specifies whether a single point or multiple points can be selected in the chart.

redrawOnResize

Specifies whether to redraw the UI component when the size of the parent browser window changes or a mobile device rotates.

resolveLabelOverlapping

Specifies how a chart must behave when point labels overlap.

rtlEnabled

Switches the UI component to a right-to-left representation.

segmentsDirection

Specifies the direction that the pie chart segments will occupy.

series

Specifies properties for the series of the PieChart UI component.

seriesTemplate

Defines properties for the series template.

size

Specifies the UI component's size in pixels.

sizeGroup

Allows you to display several adjoining pies in the same size.

startAngle

Specifies the angle in arc degrees from which the first segment of a pie chart should start.

theme

Sets the name of the theme the UI component uses.

title

Configures the UI component's title.

tooltip

Configures tooltips.

type

Specifies the type of the pie chart series.

See Also

Methods

Name Description
beginUpdate()

Prevents the UI component from refreshing until the endUpdate() method is called.

clearSelection()

Deselects the chart's selected series. The series is displayed in an initial style.

dispose()

Disposes of all the resources allocated to the PieChart instance.

element()

Gets the root UI component element.

endUpdate()

Refreshes the UI component after a call of the beginUpdate() method.

exportTo(fileName, format)

Exports the UI component.

getAllSeries()

Gets all the series.

getDataSource()

Gets the DataSource instance.

getInnerRadius()

Gets the radius of the doughnut hole in pixels. Applies only when the type is "doughnut" or "donut".

getInstance(element)

Gets the instance of a UI component found using its DOM node.

getSeriesByName(seriesName)

Gets a series with a specific name.

getSeriesByPos(seriesIndex)

Gets a series with a specific index.

getSize()

Gets the current UI component size.

hideLoadingIndicator()

Hides the loading indicator.

hideTooltip()

Hides all UI component tooltips.

instance()

Gets the UI component's instance. Use it to access other methods of the UI component.

off(eventName)

Detaches all event handlers from a single event.

off(eventName, eventHandler)

Detaches a particular event handler from a single event.

on(eventName, eventHandler)

Subscribes to an event.

on(events)

Subscribes to events.

option()

Gets all UI component properties.

option(optionName)

Gets the value of a single property.

option(optionName, optionValue)

Updates the value of a single property.

option(options)

Updates the values of several properties.

print()

Opens the browser's print window.

refresh()

Reloads data and repaints the UI component.

render()

Redraws the UI component.

render(renderOptions)

Redraws the UI component.

resetOption(optionName)

Resets an property to its default value.

showLoadingIndicator()

Shows the loading indicator.

svg()

Gets the UI component's SVG markup.

See Also

Events

This section describes events fired by this UI component.

Name Description
disposing

Raised before the UI component is disposed of.

done

Raised when all series are ready.

drawn

Raised when the UI component's rendering has finished.

exported

Raised after the UI component is exported.

exporting

Raised before the UI component is exported.

fileSaving

Raised before a file with exported UI component is saved to the user's local storage.

incidentOccurred

Raised when an error or warning occurs.

initialized

Raised only once, after the UI component is initialized.

legendClick

Raised when a legend item is clicked or tapped.

optionChanged

Raised after a UI component property is changed.

pointClick

Raised when a series point is clicked or tapped.

pointHoverChanged

Raised after the pointer enters or leaves a series point.

pointSelectionChanged

Raised when a series point is selected or selection is canceled.

tooltipHidden

Raised when a tooltip becomes hidden.

tooltipShown

Raised when a tooltip appears.

See Also

Series Types

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

Type:

Object

Chart Elements

This section describes chart elements.