Pie charts percentage labels are not displayed

Posted by: olivier.rondeau on 27 November 2019, 1:59 am EST

  • Posted 27 November 2019, 1:59 am EST


    Some charts as pie charts has, in the series label properties, a Percentage label data option.

    It's not just a format (like the format number options juste below), but a label data that calculates the percentage of the pie per data.

    this particular tag option is not included in the spread (nothing appears).

    Is it possible to have an evolution so the value appears again.

    (NB : In Excel, the percentage value on the pie are : 67 % and 33 %).

    Thank you !
  • Marked as Answer

    Replied 27 November 2019, 5:50 pm EST


    Sorry, we do not support convert and display the series data label as percentage rely on percentage calculation.

    As a workaround, you could self-calculate series' value to value that total value is equal 1 (100%) like below code:

    FarPoint.Win.Spread.Model.GeneralFormatter test = new FarPoint.Win.Spread.Model.GeneralFormatter();
    test.SetFormatString("%0", false);
    fpSpread1.ActiveSheet.Cells[0, 0].Value = 0.25;
    fpSpread1.ActiveSheet.Cells[1, 0].Value = 0.35;
    fpSpread1.ActiveSheet.Cells[2, 0].Value = 0.15;
    fpSpread1.ActiveSheet.Cells[3, 0].Value = 0.25;
    SpreadChart chart=fpSpread1.ActiveSheet.AddChart(0, 0, typeof(PieSeries), 200, 200, 150, 200);
    PieSeries series = (PieSeries)chart.Model.PlotAreas[0].Series[0];
    series.LabelFormatter = test;
    series.LabelVisible = true;

    Hope it helps.

  • Replied 16 December 2019, 7:14 pm EST

    The percentage calculation for the pie chart always stays the same, right ?
    This is a fairly specific case which only applies to the sector chart, and the spread must copy the behavior of Excel even in these specificities.
    It would only be normal for you to set up that by default, following the Excel calculation method for this specific case.
    Knowing that, will you or will you not implement by default the interpretation of the Percentage parameter in the sector graphs ?
    It would complete, even finalize, the graphical interpretation of the spread.
  • Replied 18 December 2019, 9:31 pm EST

    Hello Oliver,

    I have forwarded this to our development team as an enhancement request(277839).

  • Replied 20 May 2021, 7:05 pm EST

    Hi Oliver,

    The LabelContainsPercentage property (https://www.grapecity.com/spreadnet/docs/v14/online-win/FarPoint.Win.Chart~FarPoint.Win.Chart.PieSeries~LabelContainsPercentage.html?highlight=labelcontainspercentage%2C) has been added to PieSeries to enable this.

    This enhancement is added in Spread 14 SP1 update.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels