Home » .Net FrameworkRSS

Shows Percentages on Pie Chart ( Aspnet)

I have pie chart show the count of my customers.

1,2,2,1 - Counts in my sales orders. But it shows the totals and I want to view them as percentages on my pie chart

 

(12.5%, 25%, 25%, 12.5% ) respectively.

What property can I set to view as a percentage or do I have to change my values around and format a percent sign.

 

Nick

 

5 Answers Found

 
 

Answer 2

I just have 1 last issue.

Thanks for the links. They helped a lot.

I have the Percent showing and the legend text formatted, but on the Percent showing it has decimal point I want them removed to show  as an int instead. Any ideas? I tried tons of combinations

      Chart1.Series.Clear();
      Chart1.Series.Add("Sales By Customer");

      Chart1.Series[0].XValueMember = "Name";
      Chart1.Series[0].YValueMembers = "Count";
      Chart1.Series[0].ChartType = SeriesChartType.Pie;
      Chart1.Series[0].IsValueShownAsLabel = true;
      Chart1.Series[0].Label = "#PERCENT";
      //Chart1.Series[0].LabelFormat = "{0:0%}";
      Chart1.Series[0].LegendText = "#AXISLABEL";

      Chart1.Series[0]["PieDrawingStyle"] = "Concave";

Any help is appreciated,

Nick

 

Answer 3

The answer was #PERCENT{P0}

 

Apparently PO means Percent with 0 decimal spots. Wish I knew where to find all the formatting with MSChart rules are...oh well

 

Answer 4

hey Nick

all those are just standard .NET String formats

you can start here:

http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx

 

Answer 5

hey Nick

all those are just standard .NET String formats

you can start here:

http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx


Ahh so it is...I always stopped reading at C and D.

Thanks for the info,

it makes more sense now.

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter