Flex Pie Data Label

Posted by: grapecity on 28 April 2019, 11:19 pm EST

    • Post Options:
    • Link

    Posted 28 April 2019, 11:19 pm EST

    Hello,

    I want to add data label on the flex pie using the ff code. This code works on flex chart but not on flex pie

    flexPie1.DataLabel.Content = “{Amount}”;

    flexPie1.DataLabel.Position = C1.Chart.PieLabelPosition.Circular

    Thanks

    Ricky

  • Posted 29 April 2019, 3:08 am EST

    Hi Ricky,

    I could not reproduce the issue at my end by using the specified settings(and control version 4.0.20191.359). So, I am attaching the sample (prj_FlexPieLabels.zip) that I tested with and would request you to confirm the behavior using this sample. Also, please let me know if I am missing something.

    Thanks,

    Basant

    prj_FlexPieLabels.zip

  • Posted 29 April 2019, 10:26 pm EST - Updated 4 October 2022, 1:17 am EST

    Hi Basant,

    Thank you for your immediate reply. Your sample works but when I changed the datasource into DataTable type, it does not work show the values.

    Here’s my datatable

    public DataTable GetTable()

    {

    // Here we create a DataTable with 2 columns.

    DataTable table = new DataTable();

    table.Columns.Add(“Name”, typeof(string));

    table.Columns.Add(“Marks”, typeof(double));

            // Here we add 4 DataRows.
            table.Rows.Add("Name 1", "100");
            table.Rows.Add("Name 2", "150");
            table.Rows.Add("Name 3", "200");
            table.Rows.Add("Name 4", "250");
            return table;
        }
    

    Ricky

  • Posted 29 April 2019, 10:50 pm EST

    Hello Basant,

    I got it to work by using DefaultView of the DataTable as the datasource instead.

    Thanks.

    Ricky

Need extra support?

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

Learn More

Forum Channels