none
How to use data labels for Excel Pie chart created using C# ?? RRS feed

  • Question

  • I am creating Excel Pie chart from C# and i am getting chart like this

    i used DataLabel query in following way :

    chartPage.ApplyDataLabels();

    i want data labels displayed such that it should give me graph like this :

    Also , how to change colors of different regions of pie chart??


    Thursday, August 8, 2013 5:19 AM

Answers


  • Hi sagarvasekar007,

      Welcome to MSDN Forum Support.

      For more information about how to change colors of different regions of pie chart,you can use PIA or Open XM to impelment it,here I only list PIA way to do so.

    public void a()
    {
    	ActiveSheet.ChartObjects("Chart 1").Activate();
    	ActiveChart.SeriesCollection(1).Points.Item(1).Interior.ColorIndex = 7;
    }

    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, August 19, 2013 9:26 AM

All replies

  • Hi sagarvasekar007,

    This forum is to discuss problems of Testing with Visual Studio Test Manager (MTM). Your questions is not related to the topic of this forum and it's related to C#. I will move your thread to C# Genetal forum which you can get more efficient responses.

    Thanks

    Best Regards


    Starain Chen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, August 9, 2013 1:39 AM

  • Hi sagarvasekar007,

      Welcome to MSDN Forum Support.

      For more information about how to change colors of different regions of pie chart,you can use PIA or Open XM to impelment it,here I only list PIA way to do so.

    public void a()
    {
    	ActiveSheet.ChartObjects("Chart 1").Activate();
    	ActiveChart.SeriesCollection(1).Points.Item(1).Interior.ColorIndex = 7;
    }

    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, August 19, 2013 9:26 AM