C1Chart Pie Chart DataLabel Text Percent not working

Posted by: moforiappiah on 3 November 2017, 6:41 am EST

    • Post Options:
    • Link

    Posted 3 November 2017, 6:41 am EST

    I am trying to display to display labels with percentage in C1.Chart Pie chart but the value is not converted to percentage. When I use the code series.DataLabel.Text = “{#TEXT}\r\n{#YVAL} ({%YVAL:%})”;, the {%YVAL:%} displays (%) instead of for example (30%) though the figures are whole number.

  • Posted 6 November 2017, 12:40 am EST

    Hi,

    In order to show the value along with percent symbol, please replace your code:

    series.DataLabel.Text = "{#TEXT}\r\n{#YVAL} ({%YVAL:%})";
    

    with

    series.DataLabel.Text =  "{#TEXT}\r\n{#YVAL} ({%YVAL:[b]0.00%[/b]})";
    

    This should help you get the desired output.

    Let me know if you need anything else.

    Regards,

    Ruchir Agarwal

  • Posted 6 November 2017, 5:23 am EST

    Hi Ruchir,

    Your suggestion worked. Thanks for your assistance.

    Regards,

    Michael

Need extra support?

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

Learn More

Forum Channels