EJSC.PieSeries Property Examples

Properties Demonstrated

  • Standard EJSC.PieSeries Properties

Desired Result

Default EJSC.PieSeries Settings

Source Code

    Rendering Source Code...

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

    Rendering Source Code...

Properties Demonstrated

  • position
  • height
  • width

Desired Result

Display four pie series in a single chart.

Source Code

    Rendering Source Code...

Properties Demonstrated

  • total_value
  • Custom hint property [total]
  • Custom hint property [percent]

Desired Result

Display a pie series which does not fill the entire circle (total value is greater than the sum of all pieces) and shows hints with the piece percentage of total value as well as its actual value and the pie series total value.

Source Code

    Rendering Source Code...

Defining Custom Pie Colors as necessary

It may be necessary to have additional control over which color each pie piece uses. To handle this situation, the EJSC.PieSeries has the onPieceNeedsColor event which if assigned will fire every time a piece needs to determine its color. Used in conjunction piece label or the userdata attribute of the XML formats, it is possible to keep consistent colors associated with specific pie piece values (i.e. Widgets will always be blue, regardless of the actual value of with Widgets piece for the given display)

The following code demonstrates this functionality by assigning colors based on the piece label value:

    Rendering Source Code...