Skip to content

a configurable, interactive 3d pie chart in your browser

License

Notifications You must be signed in to change notification settings

thierryVergult/CandyPie

Repository files navigation

CandyPie

a configurable, interactive 3d pie chart in your browser

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

playground

Try it out, see all configuration options, in the playground.

usage

  1. Load first the babylon.js code into your webpage, and add then the candy-pie javascript.

  2. 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'
};

screenshots

Screenshot-candy-pie

Screenshot-candy-pie2

more

more info, examples and configuration options

About

a configurable, interactive 3d pie chart in your browser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published