SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

0
0

Is there a way to provide custom text for the labels in a PieChartSegment? I want to format the text, but haven’t been able to find a label formatter for the pie charts.

Version
2.2.1.2260
  • You must to post comments
0
0

Hi There,

To do that, you will need to override PieSeries and override the getLabelTextForSegment method. Please see the code below:

class CustomPieSeries: SCIPieRenderableSeries {
    override func getLabelText(for segment: SCIPieSegment!, totalValue value: Double) -> String! {
        // Format your values here
        return "CUSTOM STRING HERE"
    }
}

Hope that helps.

Best Regards,
Nazar.

  • Mobile Developers
    Is there also a way to place attributed text? or get access to the actual label?
  • Nazar
    Those are not labels, and unfortunately that’s not supported for pie\donut chart. Best Regards, Nazar R.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

SciChart WPF v6 BETA released! Note pricing/licensing changes are coming. Contact us to beat the rise!Read more
+