Pie Chart Size

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

Pie Chart Size

Post by MikeTheLad » Tue Aug 22, 2006 10:29 am

My Pie Chart gets smaller as the data qty increases, ie a pie with 2 values, one of 4 and one 3, this is correct size. Another pie with the same size but has 2 values one, 3000 and one of 6000 and the pie is very small. The chart size in both cases is Width="508px" Height="221px"

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Aug 22, 2006 12:11 pm

Hi MikeTheLad,

This is because the legend strings are longer and this takes space from the rest of the chart area. You can solve this by making the legend not visible or forcing the ValueFormat having 3 fix decimal digits:

Code: Select all

      pie1.Add(4);
      pie1.Add(3);
      pie1.ValueFormat = "#,##0.000";

      pie2.Add(2000);
      pie2.Add(3000);
Best Regards,
Narcís Calvet / 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: 11
Joined: Mon Jan 19, 2004 5:00 am

Post by MikeTheLad » Tue Aug 22, 2006 2:43 pm

Thanks, sorted this. On the legend I would like this to show a £ before the number is this possible?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Aug 22, 2006 2:54 pm

Hi MikeTheLad,

Yes, you can achieve that using the GetLegendText event adding the symbol to the legend text string.
Best Regards,
Narcís Calvet / 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: 11
Joined: Mon Jan 19, 2004 5:00 am

Post by MikeTheLad » Tue Aug 22, 2006 3:13 pm

Understand what you are saying, I have created the event as per tuturial 5 but when I build the project I get,

the type name 'GetLegendTextEventArgs' does not exist in the type 'Steema.TeeChart.TChart'

when I type Steema.TeeChart.TChart. in the event on the list of available command GetLegendText is not there.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Aug 22, 2006 3:28 pm

Hi MikeTheLad,

You can automatically create the even at TeeChart's event section in the property window or at run-time like this:

Code: Select all

    private void Form1_Load(object sender, EventArgs e)
    {
      candle1.FillSampleValues();

      tChart1.GetLegendText += new Steema.TeeChart.GetLegendTextEventHandler(tChart1_GetLegendText);
    }

    void tChart1_GetLegendText(object sender, Steema.TeeChart.GetLegendTextEventArgs e)
    {
      e.Text = "£" + e.Text;
    }
Best Regards,
Narcís Calvet / 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: 11
Joined: Mon Jan 19, 2004 5:00 am

Post by MikeTheLad » Wed Aug 23, 2006 9:55 am

Is it possible to position the legend at the bottom of the pie, rather than the right.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Aug 23, 2006 10:09 am

Hi MikeTheLad,

Yes, this is possible. You can do that using the chart editor at design-time or at run-time using:

Code: Select all

            tChart1.Legend.Alignment   = Steema.TeeChart.LegendAlignments.Bottom;
Best Regards,
Narcís Calvet / 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: 11
Joined: Mon Jan 19, 2004 5:00 am

Post by MikeTheLad » Wed Aug 23, 2006 10:30 am

this has moved the legend to bottom, however the 2 lines of the legend are now side by side, whereas when on the right they we two lines on top of each other. Is it possible to have the two lines on top of each other on legend at the bottom.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Aug 23, 2006 11:21 am

Hi MikeTheLad,

Ok, then you can use legend's custom position:

Code: Select all

      tChart1.Legend.CustomPosition = true;
      tChart1.Legend.Top = tChart1.Height - 50;
      tChart1.Legend.Left = tChart1.Width / 2;

      tChart1.Panel.MarginBottom = 15;
Best Regards,
Narcís Calvet / 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

Post Reply