Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8154615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:24:45+00:00 2026-06-06T16:24:45+00:00

I create Pie Chart in VS 2008 C# Project using Microsoft Office Interop Excel.

  • 0

I create Pie Chart in VS 2008 C# Project using Microsoft Office Interop Excel.

The code is:

Excel.Chart xlChart = (Excel.Chart)xlWorkBook
        .Charts
        .Add(Type.Missing, Type.Missing, Type.Missing, Type.Missing);                

Excel.Range xlDataRange = xlWorkSheet
        .get_Range(xlWorkSheet.Cells[
                       nDataForDiagramRow - alToExcelInvestmentGroupNames.Count,
                       _nColumnsCount - 3
                   ],
                   xlWorkSheet.Cells[
                       nDataForDiagramRow - 1, 
                       _nColumnsCount - 2
                   ]);

xlChart.ChartType = Excel.XlChartType.xl3DPieExploded;
xlChart.Elevation = 60;
xlChart.Rotation = 130;

xlChart.SetSourceData(xlDataRange, Type.Missing);
xlChart.ApplyDataLabels(Excel.XlDataLabelsType.xlDataLabelsShowLabelAndPercent,
                        Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                        Type.Missing, Type.Missing, Type.Missing, Type.Missing,
                        Type.Missing);

xlChart.Location(Excel.XlChartLocation.xlLocationAsObject, xlWorkSheet.Name);

With method xlChart.ApplyDataLabels I make Labels and Percentage visible, but Percentage is Rounded.

How to access the format of label to show fractional part of percentage?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:24:47+00:00Added an answer on June 6, 2026 at 4:24 pm

    I’ve founded the solution myself.
    nLabel is int number of label in collection of labels in chart.

    Excel.Series xlSeries = (Excel.Series)xlWorkBook.ActiveChart.SeriesCollection(1);
    
    Excel.DataLabel dl = (Excel.DataLabel)xlSeries.DataLabels(nLabel);
    
    dl.NumberFormat = "0.0%";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using SSRS BIDS 2008 to create a Pie Chart in one of my reports.
So I am using this jquery plugin to create a nice pie chart on
I am using this plugin to create charts: http://www.filamentgroup.com/lab/update_to_jquery_visualize_accessible_charts_with_html5_from_designing_with/ The code works below if
I'm using the Raphaël—JavaScript Library to create some pie chart graphics, but I want
i want to create one app which draw different charts like pie chart, line
I want to create a pie chart using JPgraph. in a php file i've
I am using ZedGraph to create a pie chart, and adding items to it
HI im trying to create simple pie chart using the MS Chart controls. When
Hi I am trying to create a simple pie chart using the HTML canvas
I am trying to create a simple and animated pie chart using CAShapeLayer .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.