Emprise Javascript Charts

Pie Series

EJSC.PieSeries Property Examples

Properties Demonstrated

  • Standard EJSC.PieSeries Properties

Desired Result

Default EJSC.PieSeries Settings

Properties Demonstrated

  • defaultColors
  • treeLegend

Desired Result

This chart will have a new set of colors defined as the pool of colors to be used when creating the pie pieces, and show its items in the legend in a treeview format.

Source Code

  1. <script type=”text/javascript”>
  2.   var chart = new EJSC.Chart(“myChart1a”, {
  3.     show_legend: false
  4.   });
  5.   chart.addSeries(new EJSC.PieSeries(
  6.     new EJSC.ArrayDataHandler([[3,”Widgets”],
  7.       [7,”Doodads”],[4,”Thingamagigs”],
  8.       [10,”Whatchamacallits”],[2,”Gizmos”],
  9.       [5,”Thingies”]])
  10.   ));
  11. </script>

Source Code

  1. <script type=”text/javascript”>
  2.   var chart = new EJSC.Chart(“myChart1b”, {
  3.   });
  4.   chart.addSeries(new EJSC.PieSeries(
  5.     new EJSC.ArrayDataHandler([[3,”Widgets”],
  6.       [7,”Doodads”],[4,”Thingamagigs”],
  7.       [10,”Whatchamacallits”],[2,”Gizmos”],
  8.       [5,”Thingies”]]
  9.     ),
  10.     {
  11.       treeLegend: true ,
  12.       defaultColors: [
  13.           ‘rgb(255,140,0)’,  //DarkOrange
  14.           ‘rgb(178,34,34)’,  //FireBrick
  15.           ‘rgb(153,50,204)’,  //DarkOrchid
  16.           ‘rgb(255,255,0)’,  //Yellow
  17.           ‘rgb(112,219,147)’,  //AquaMarine
  18.           ‘rgb(35,107,142)’  //SteelBlue
  19.       ]
  20.     }
  21.   ));
  22. </script>
Spread the love