ZoomCharts Documentation
Version: 1.21.4 (2025-05-13)
Switch to Version 2.0 (BETA)
Switch to Version 2.0 (BETA)
Object structure
The pie chart consists of Pie objects and Slice objects. The pie objects form a stack of pies, the outermost being active and inner ones being in background.
The following read-only fields are available. All other fields in the objects are considered internal and subject to change. Each object also has a collection of style fields you can assign to, described in the style section.
Pie fields
id
- pie iddata
- pie data as received from data sourceslices
- array of currently visible slicesoffset
- offset in data for visible slicescount
- number of visible slicesactiveSlice
- active slice object if the pie has active slice openothersSlice
- others slice object or nullpreviousSlice
- previous slice object or nullparentSlice
- parent slice object if the pie has parentbackground
- the pie is a background pie, the slices are not clickable, true or false.
Slice fields
id
- slice iddata
- slice data as received from data sourceindex
- index in the data arrayvalue
- the slice value from datapercent
- percents of total the value represents, 0..100fraction
- visual fraction from full pie, 0..1. Will be different from percent if pie offset is not 0.expandable
- if clicking on the slice will expand it, true of falseselected
- if is selected, true of falseactive
- if is under the cursor, true of false.
Api methods
The following chart API methods return chart objects:
chart.getActivePies()
- returns array of pie objects representing stack of all drilled down layers. First being the innermost.chart.getActivePie()
- returns outermost pie layer.chart.getActiveSlices()
- returns array of visible slices for outermost pie layer.