Let's break down that sentence ..
- candy: don't take it that seriously. Pie charts are not always loved.. One should not use 3d for charts.. Negative times negative equals positive?
- pie: yes indeed, a pie chart. See above.
- configurable: all options are described in the playground. Curious which other options will prove to be interesting later on.
- interactive: the result is not a static image, but a 3d object one can drive.
- 3d: standing on the shoulders of babylon.js
- browser: works in a modern browser, desktop & mobile
Try it out, see all configuration options, in the playground.
-
Load first the babylon.js code into your webpage, and add then the candy-pie javascript.
-
Define a canvas element in your html page, and call one single javascript function to place the 3d pie chart on that canvas element. All data and configuration options are defined in one single javascript object.
Supports two data sets, one that sets the height of the slices, and one (optional) set that sets the angle (width) of the slices.
example
let myPie3d = {
'htmlCanvasId': 'candy-pie-id01',
'slices': [
{ 'height': 100, 'color': 'indianred'},
{ 'height': 100, 'color': 'steelblue'},
{ 'height': 100, 'color': 'olive'}
],
'spaceBetweenSlices': true,
'innerRadiusPct': 40,
'backgroundColor': 'lightgrey'
};