LSPS documentation logo
LSPS Documentation
Pie Chart

The Pie Chart component renders as a circular chart that depicts data values as sections. When clicked, it produces a ChartClickEvent with data about what was clicked so the system can process the click as required.

It produces events of the following types:

  • InitEvent when the component is initialized or displayed if previously hidden
  • ChartClickEvent when the user clicks a chart
pieChart.png
Pie chart with legend
The Pie Chart component has the following properties:

  • Title: pie chart main title
  • Subtitle: pie chart subtitle
  • Slices: pie chart sections (a list of slices displayed in the pie chart)

    The slices define their label and value: the Slice value is defined as a decimal value and represents the mutual ratio of individual slices.

    collect(
      getCurrentAssets(),
      {asset ->
        new ui::PieSlice(
          label -> asset.ISIN,
          value -> asset.currentAmount)
      }
    )
    
  • Show legend: visibility of the chart legend (if true, the legend is visible)