Pie Charts
-
- Newbie
- Posts: 65
- Joined: Mon Jan 19, 2004 5:00 am
Pie Charts
2 Questions on the pie charge sample attached,
1. how can I add the % symbol next to the figure
My code is:-
pie.Add(Convert.ToInt32(ethnicperc1), "White", Color.FromArgb(49, 151, 101));
pie.Add(Convert.ToInt32(ethnicperc2), "Mixed", Color.FromArgb(255, 255, 255));
pie.Add(Convert.ToInt32(ethnicperc3), "Asian", Color.FromArgb(245, 152, 31));
pie.Add(Convert.ToInt32(ethnicperc4), "Black", Color.FromArgb(205, 205, 205));
pie.Add(Convert.ToInt32(ethnicperc5), "Other" , Color.FromArgb(244, 243, 160));
pie.Add(Convert.ToInt32(ethnicperc6), "Not Answered", Color.FromArgb(157, 197, 233));
pie.Rotate(90);
2. The pie appears to be generated anticlockwise, is there a way of make it clockwise
1. how can I add the % symbol next to the figure
My code is:-
pie.Add(Convert.ToInt32(ethnicperc1), "White", Color.FromArgb(49, 151, 101));
pie.Add(Convert.ToInt32(ethnicperc2), "Mixed", Color.FromArgb(255, 255, 255));
pie.Add(Convert.ToInt32(ethnicperc3), "Asian", Color.FromArgb(245, 152, 31));
pie.Add(Convert.ToInt32(ethnicperc4), "Black", Color.FromArgb(205, 205, 205));
pie.Add(Convert.ToInt32(ethnicperc5), "Other" , Color.FromArgb(244, 243, 160));
pie.Add(Convert.ToInt32(ethnicperc6), "Not Answered", Color.FromArgb(157, 197, 233));
pie.Rotate(90);
2. The pie appears to be generated anticlockwise, is there a way of make it clockwise
- Attachments
-
- RTE_488_Ethnic.jpg (44.3 KiB) Viewed 36392 times
Re: Pie Charts
Hello MikeTheLad,
For example:
I hope will helps.
Thanks,
You need use property Style of Marks as do in next simple code:1. how can I add the % symbol next to the figure
Code: Select all
private void InitializeChart()
{
Steema.TeeChart.Styles.Pie pie = new Steema.TeeChart.Styles.Pie(tChart1.Chart);
tChart1.Legend.Visible = true;
tChart1.Header.Text = "";
pie.Circled = true;
tChart1.Chart.Panel.Color = System.Drawing.Color.White;
tChart1.Chart.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
tChart1.Chart.Panel.Bevel.Inner = Steema.TeeChart.Drawing.BevelStyles.None;
tChart1.Aspect.View3D = false;
Random rnd = new Random();
int ethnicperc1, ethnicperc2, ethnicperc3, ethnicperc4, ethnicperc5, ethnicperc6;
ethnicperc1 = 74;
ethnicperc2 = 4;
ethnicperc3 = 6;
ethnicperc4 = 2;
ethnicperc5 = 5;
ethnicperc6 = 8;
pie.Marks.Style = MarksStyles.LabelPercent;
pie.CustomXRadius = 120;
pie.CustomYRadius = 120;
pie.Add(ethnicperc1, "White", Color.FromArgb(49, 151, 101));
pie.Add(ethnicperc2, "Mixed", Color.FromArgb(255, 255, 255));
pie.Add(ethnicperc3, "Asian", Color.FromArgb(245, 152, 31));
pie.Add(ethnicperc4, "Black", Color.FromArgb(205, 205, 205));
pie.Add(ethnicperc5, "Other", Color.FromArgb(244, 243, 160));
pie.Add(ethnicperc6, "Not Answered", Color.FromArgb(157, 197, 233));
pie.Rotate(180);
}
I recommend you change the angle of rotation to achieve make the pie as clockwise.2. The pie appears to be generated anticlockwise, is there a way of make it clockwise
For example:
Code: Select all
pie.Rotate(180);
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 65
- Joined: Mon Jan 19, 2004 5:00 am
Re: Pie Charts
Hi adding the styles has made no difference, my code is:-
Steema.TeeChart.TChart tChart2 = new Steema.TeeChart.TChart();
Steema.TeeChart.Styles.Pie pie = new Steema.TeeChart.Styles.Pie(tChart2.Chart);
tChart2.Legend.Visible = true;
tChart2.Header.Text = "";
tChart2.Chart.Panel.Color = System.Drawing.Color.White;
tChart2.Chart.Panel.Visible = false;
tChart2.Chart.Walls.Visible = false;
tChart2.Chart.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
tChart2.Chart.Panel.Bevel.Inner = Steema.TeeChart.Drawing.BevelStyles.None;
tChart2.Aspect.View3D = false;
pie.Marks.Visible = false;
pie.Marks.Pen.Visible = false;
pie.Marks.Arrow.Visible = false;
pie.Circled = true;
pie.Marks.Style = Steema.TeeChart.Styles.MarksStyles.LabelPercent;
pie.CustomXRadius = 120;
pie.CustomYRadius = 120;
pie.Circled = true;
pie.Add(Convert.ToInt32(ethnicperc1), "White", Color.FromArgb(49, 151, 101));
pie.Add(Convert.ToInt32(ethnicperc2), "Mixed", Color.FromArgb(255, 255, 255));
pie.Add(Convert.ToInt32(ethnicperc3), "Asian", Color.FromArgb(245, 152, 31));
pie.Add(Convert.ToInt32(ethnicperc4), "Black", Color.FromArgb(205, 205, 205));
pie.Add(Convert.ToInt32(ethnicperc5), "Other" , Color.FromArgb(244, 243, 160));
pie.Add(Convert.ToInt32(ethnicperc6), "Not Answered", Color.FromArgb(157, 197, 233));
pie.Rotate(90);
As for the rotatation, I have already tried pie.Rotate(180); this does help I need the green section to start at the top and be clockwise until the other colours appear to left, ie as if the image is flipped
Steema.TeeChart.TChart tChart2 = new Steema.TeeChart.TChart();
Steema.TeeChart.Styles.Pie pie = new Steema.TeeChart.Styles.Pie(tChart2.Chart);
tChart2.Legend.Visible = true;
tChart2.Header.Text = "";
tChart2.Chart.Panel.Color = System.Drawing.Color.White;
tChart2.Chart.Panel.Visible = false;
tChart2.Chart.Walls.Visible = false;
tChart2.Chart.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
tChart2.Chart.Panel.Bevel.Inner = Steema.TeeChart.Drawing.BevelStyles.None;
tChart2.Aspect.View3D = false;
pie.Marks.Visible = false;
pie.Marks.Pen.Visible = false;
pie.Marks.Arrow.Visible = false;
pie.Circled = true;
pie.Marks.Style = Steema.TeeChart.Styles.MarksStyles.LabelPercent;
pie.CustomXRadius = 120;
pie.CustomYRadius = 120;
pie.Circled = true;
pie.Add(Convert.ToInt32(ethnicperc1), "White", Color.FromArgb(49, 151, 101));
pie.Add(Convert.ToInt32(ethnicperc2), "Mixed", Color.FromArgb(255, 255, 255));
pie.Add(Convert.ToInt32(ethnicperc3), "Asian", Color.FromArgb(245, 152, 31));
pie.Add(Convert.ToInt32(ethnicperc4), "Black", Color.FromArgb(205, 205, 205));
pie.Add(Convert.ToInt32(ethnicperc5), "Other" , Color.FromArgb(244, 243, 160));
pie.Add(Convert.ToInt32(ethnicperc6), "Not Answered", Color.FromArgb(157, 197, 233));
pie.Rotate(90);
As for the rotatation, I have already tried pie.Rotate(180); this does help I need the green section to start at the top and be clockwise until the other colours appear to left, ie as if the image is flipped
Re: Pie Charts
Hello MikeTheLad,
I hope will helps.
Thanks,
If you want see the difference you achieve changing style of Marks, you need Marks.Visible=true. Please change Marks.Visible=false to Marks.Visible=true and see the results.Hi adding the styles has made no difference, my code is:-
Ok. I try change the angle rotation 90 to 270 and I have gotten next image: Can you tell us if image have the results as you want?As for the rotatation, I have already tried pie.Rotate(180); this does help I need the green section to start at the top and be clockwise until the other colours appear to left, ie as if the image is flipped
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 65
- Joined: Mon Jan 19, 2004 5:00 am
Re: Pie Charts
The % symbol I require on the legend next the figures, but not on the graph.
I have created in Phtoshop what I require the pie to look like
I have created in Phtoshop what I require the pie to look like
- Attachments
-
- RTE_488_Ethnic_Flipped.jpg (27.62 KiB) Viewed 36320 times
Re: Pie Charts
Hello MikeTheLad,
Ok. Seems finally I have understood you want achieve. I have made a simple code where used an auxiliary pie series to save the originaly values and other series to manipulate values. Please see next code and check if works as you want:
I hope will helps.
Thanks,
Ok. Seems finally I have understood you want achieve. I have made a simple code where used an auxiliary pie series to save the originaly values and other series to manipulate values. Please see next code and check if works as you want:
Code: Select all
Steema.TeeChart.Styles.Pie pie1, pieaux;
private void InitializeChart()
{
tChart2.Aspect.View3D = false;
pieaux = new Steema.TeeChart.Styles.Pie();
pie1 = new Steema.TeeChart.Styles.Pie(tChart2.Chart);
tChart2.Header.Text = "";
tChart2.Chart.Panel.Color = System.Drawing.Color.White;
tChart2.Chart.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
tChart2.Chart.Panel.Bevel.Inner = Steema.TeeChart.Drawing.BevelStyles.None;
Random rnd = new Random();
int ethnicperc1, ethnicperc2, ethnicperc3, ethnicperc4, ethnicperc5, ethnicperc6;
ethnicperc1 = 94;
ethnicperc2 = 0;
ethnicperc3 = 1;
ethnicperc4 = 1;
ethnicperc5 = 0;
ethnicperc6 = 4;
// Save Originaly values.
pieaux.Add(ethnicperc1, "White", Color.FromArgb(49, 151, 101));
pieaux.Add(ethnicperc2, "Mixted", Color.FromArgb(255, 255, 255));//white
pieaux.Add(ethnicperc3, "Asian", Color.FromArgb(245, 152, 31));//Orange
pieaux.Add(ethnicperc4, "Black", Color.FromArgb(205, 205, 205));//Grey
pieaux.Add(ethnicperc5, "Other", Color.FromArgb(244, 243, 160));//Yellow
pieaux.Add(ethnicperc6, "Not Answered", Color.FromArgb(157, 197, 233));//blue skye
//Add values
pie1.Add(pieaux.YValues[5], pieaux.Labels[5], pieaux.Colors[5]);
pie1.Add(pieaux.YValues[4], pieaux.Labels[4], pieaux.Colors[4]);
pie1.Add(pieaux.YValues[3], pieaux.Labels[3], pieaux.Colors[3]);
pie1.Add(pieaux.YValues[2], pieaux.Labels[2], pieaux.Colors[2]);
pie1.Add(pieaux.YValues[1], pieaux.Labels[1], pieaux.Colors[1]);
pie1.Add(pieaux.YValues[0], pieaux.Labels[0], pieaux.Colors[0]);
pie1.Rotate(90);
tChart2.Legend.Inverted = true;
pie1.Marks.Visible = false;
pie1.Marks.Pen.Visible = false;
pie1.Marks.Arrow.Visible = false;
pie1.Circled = true;
pie1.Marks.Style = MarksStyles.LabelPercent;
pie1.CustomXRadius = 120;
pie1.CustomYRadius = 120;
tChart2.Panel.MarginRight = 20;
}
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 65
- Joined: Mon Jan 19, 2004 5:00 am
Re: Pie Charts
Thank you, that worked, any ideas how I can do the % symbol in the legend, ie
94% white
0% Mixed
1% Asian
etc
If I try to add the % in the following line it fails to build
pie.Add(Convert.ToInt32(ethnicperc1), "White", Color.FromArgb(49, 151, 101));
ie
pie.Add(Convert.ToInt32(ethnicperc1) & "%", "White", Color.FromArgb(49, 151, 101)); This fails
94% white
0% Mixed
1% Asian
etc
If I try to add the % in the following line it fails to build
pie.Add(Convert.ToInt32(ethnicperc1), "White", Color.FromArgb(49, 151, 101));
ie
pie.Add(Convert.ToInt32(ethnicperc1) & "%", "White", Color.FromArgb(49, 151, 101)); This fails
Re: Pie Charts
Hello MikeTheLad,
You only need change TextStyle of Lenged as do in following line of code:
I hope will helps.
Thanks,
You only need change TextStyle of Lenged as do in following line of code:
Code: Select all
tChart2.Legend.TextStyle = Steema.TeeChart.LegendTextStyles.LeftPercent;
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 65
- Joined: Mon Jan 19, 2004 5:00 am
Re: Pie Charts
Thanks, all worked, hopefully that is all
-
- Newbie
- Posts: 22
- Joined: Tue Aug 08, 2017 12:00 am
Re: Pie Charts
What is the actual part for triggering that pie data is filled up clockwise instead of default counterclockwise?
Tried playing with RotationAngle without any luck.
Tried playing with RotationAngle without any luck.
Re: Pie Charts
Hello Bank Van Breda,
I would like suggest you use the Rotate method to change the pie angle rotation and do it works in clockwise direccion. The line code below shows you how can do that:
Hoping this helps you,
Thanks in advance
I would like suggest you use the Rotate method to change the pie angle rotation and do it works in clockwise direccion. The line code below shows you how can do that:
Code: Select all
pie.Rotate(180);
Thanks in advance
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 22
- Joined: Tue Aug 08, 2017 12:00 am
Re: Pie Charts
Like I said, I'm still clearly missing the actual correct code?
So image 1 is regular pie chart, you notice that first value ( dark blue ) is followed by orange rotated counterclockwise.
Second image is same pie with the rotate 180. So now all values are flipped over horizontal axes of the pie, but still fill up counterclockwise...
Any other ideas I can test?
So image 1 is regular pie chart, you notice that first value ( dark blue ) is followed by orange rotated counterclockwise.
Second image is same pie with the rotate 180. So now all values are flipped over horizontal axes of the pie, but still fill up counterclockwise...
Any other ideas I can test?
-
- Newbie
- Posts: 22
- Joined: Tue Aug 08, 2017 12:00 am
Re: Pie Charts
Ok found out why this is happening... I added the values to the pie from large to small sorted. Seems the pie chart assumes that data is added in the other sorted direction ( from small to large ).
But because I also show a legend list, I sorted from big to small...
But problem fixed
But because I also show a legend list, I sorted from big to small...
But problem fixed
Re: Pie Charts
Hello Bank Van Breda,
I'm glad you can find a solution for your problem. I would like inform you that you can order the PieValues after adding these. You can do that using the Pie Values Order propierty. The line below shows you how can do that:
Thanks in advance
I'm glad you can find a solution for your problem. I would like inform you that you can order the PieValues after adding these. You can do that using the Pie Values Order propierty. The line below shows you how can do that:
Code: Select all
pie1.PieValues.Order = Steema.TeeChart.Styles.ValueListOrder.Descending;
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |