Search code examples
delphiteechartdelphi-xe7

How to add values to an exisiting TPieSeries via Delphi Xe7


As the title suggest, how can I add a value to an already existing pie slice in a TPieseries within the TChart component.

delphi XE7 for iOS FMX


Solution

  • Access the indexed values through the TPieSeries.PieValues property. Make an addition with the existing value. You can preinitialize the pie values with zero.

    Series1.PieValues[2] := Series1.PieValues[2] + 10;
    

    A better approach is to accumulate the values before adding them into the chart.