Pie Charts

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
MikeTheLad
Newbie
Newbie
Posts: 65
Joined: Mon Jan 19, 2004 5:00 am

Pie Charts

Post by MikeTheLad » Thu Oct 13, 2011 12:32 pm

Some queries on the attached Pie Charrt:-

On the numbers around the graph, require no box and the font to bigger

How do I force the order, We need the white to be top and then clockwise with the others
Attachments
RAL_488_Ethnic.jpg
RAL_488_Ethnic.jpg (43.48 KiB) Viewed 11852 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Pie Charts

Post by Sandra » Fri Oct 14, 2011 9:29 am

Hello MiketheLad,


I suggest you define the position of your values when you add it in the series, as do in next example of code:

Code: Select all

        Steema.TeeChart.Styles.Pie Series1;
        private void InitializeChart()
        {

            Series1 = new Steema.TeeChart.Styles.Pie(tChart1.Chart);
            Series1.Add(74);
            Series1.Add(6);
            Series1.Add(5);
            Series1.Add(8);
            Series1.Add(4);
            Series1.Marks.Style = Steema.TeeChart.Styles.MarksStyles.Percent;
   
        }
Can you tell us if previous code helps you to solve your problem?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

MikeTheLad
Newbie
Newbie
Posts: 65
Joined: Mon Jan 19, 2004 5:00 am

Re: Pie Charts

Post by MikeTheLad » Fri Oct 14, 2011 1:32 pm

I have treid changing the order, but seem unable to get the white to be at the top, also what about the box and font size of the labels next to the pie




Steema.TeeChart.TChart tChart2 = new Steema.TeeChart.TChart();
Steema.TeeChart.Styles.Pie pie = new Steema.TeeChart.Styles.Pie(tChart2.Chart);
tChart2.Legend.Visible = false;
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.Add(Convert.ToInt32(ethnicperc1), ethnicperc1 + "%", Color.FromArgb(49, 151, 101));
pie.Add(Convert.ToInt32(ethnicperc3), ethnicperc3 + "%", Color.FromArgb(245, 152, 31));
pie.Add(Convert.ToInt32(ethnicperc4), ethnicperc4 + "%", Color.FromArgb(205, 205, 205));
pie.Add(Convert.ToInt32(ethnicperc5), ethnicperc5 + "%", Color.FromArgb(244, 243, 160));
pie.Add(Convert.ToInt32(ethnicperc6), ethnicperc6 + "%", Color.FromArgb(157, 197, 233));
pie.Add(Convert.ToInt32(ethnicperc2), ethnicperc2 + "%", Color.FromArgb(255, 255, 255));

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Pie Charts

Post by Sandra » Mon Oct 17, 2011 9:37 am

Hello MikeTheLad,

Using last version of TeeChart2011 and next code:

Code: Select all

        private void InitializeChart()
        {
           Steema.TeeChart.Styles.Pie pie = new Steema.TeeChart.Styles.Pie(tChart1.Chart);
           tChart1.Legend.Visible = false;
           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.Add(ethnicperc1, ethnicperc1.ToString() + "%", Color.FromArgb(49, 151, 101));
           pie.Add(ethnicperc3, ethnicperc3.ToString() + "%", Color.FromArgb(245, 152, 31));
           pie.Add(ethnicperc4, ethnicperc4.ToString() + "%", Color.FromArgb(205, 205, 205));
           pie.Add(ethnicperc5, ethnicperc5.ToString() + "%", Color.FromArgb(244, 243, 160));
           pie.Add(ethnicperc6, ethnicperc6.ToString() + "%", Color.FromArgb(157, 197, 233));
           pie.Add(ethnicperc2, ethnicperc2.ToString() + "%", Color.FromArgb(255, 255, 255));
}
I have gotten next results:
pietest2.jpg
pietest2.jpg (38.03 KiB) Viewed 11776 times
Can you try again run previous code and tell us if you can get a good results? On the other hand, If you doesn't use last version of TeeChartFor.Net, please tell us which version are you using now.
On the numbers around the graph, require no box and the font to bigger
Sorry I forgot answer this question. If you want as the boxs of Marks don't appear and font of Marks is to bigger, you need use next properties of Marks to modify their aspect:
  • - Series.Marks.Pen.Visible = False or True;
    - Series.Marks.Color.Transparency= 100. You have indicate the % of transparency you want to marks. And also you can use Series.Marks.Transparent = true; where you indicate as if you want Mark transparent or not.
    - Series.Marks.Font.Size = 12. To Change the size of font.
I have added some of previous properties in your code:

Code: Select all

          ....
           //Marks;
           pie.Marks.Transparent = true;
           pie.Marks.Transparency = 100;
           pie.Marks.Pen.Visible = false;
           pie.Marks.Arrow.Visible = false;
           pie.Marks.Font.Size = 12;
And I have gotten next results:
pieTest1.jpg
pieTest1.jpg (36.17 KiB) Viewed 11764 times
Can you tell us, if previous lines of code works as you expected?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

MikeTheLad
Newbie
Newbie
Posts: 65
Joined: Mon Jan 19, 2004 5:00 am

Re: Pie Charts

Post by MikeTheLad » Tue Oct 18, 2011 2:26 pm

We need the graph rotating around 90 degress, sample attached of what I am trying to produce
Attachments
Graph Sample.jpg
Graph Sample.jpg (26.9 KiB) Viewed 11748 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Pie Charts

Post by Sandra » Wed Oct 19, 2011 8:16 am

Hello MikeTheLad,

Series have a method that allow rotate the Series. To achieve as you want I recommend rotate your Series an angle of 180º as do in next line of code:

Code: Select all

 pie.Rotate(180);
Can you tell us, if previous line works as you expected?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

MikeTheLad
Newbie
Newbie
Posts: 65
Joined: Mon Jan 19, 2004 5:00 am

Re: Pie Charts

Post by MikeTheLad » Wed Oct 19, 2011 11:52 am

Thanks, that is what I needed

Post Reply