Legend

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Fulcrum
Newbie
Newbie
Posts: 35
Joined: Fri Dec 21, 2012 12:00 am

Legend

Post by Fulcrum » Wed Jun 26, 2013 8:39 am

Hello, i have a pie chart with the legend at the bottom. What i would like is to put the legend elements in two colums to make it smaller

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

Re: Legend

Post by Sandra » Wed Jun 26, 2013 12:03 pm

Hello Fulcrum,

I suggest you use MaxNumRows as do in next simple code:

Code: Select all

 Dim pie As Steema.TeeChart.Styles.Pie
    Dim ch1 As Steema.TeeChart.TChart
    Private Sub Initializechart()
        ch1 = New Steema.TeeChart.TChart()
        Me.Controls.Add(ch1)
        pie = New Pie(ch1.Chart)
        pie.FillSampleValues(10)
        ch1.Legend.Alignment = Steema.TeeChart.LegendAlignments.Bottom
        ch1.Legend.MaxNumRows = 5
    End Sub
Could you tell us if previous code works in your end?

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

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

Re: Legend

Post by Sandra » Wed Jun 26, 2013 12:03 pm

Hello Fulcrum,

I suggest you use MaxNumRows as do in next simple code:

Code: Select all

 Dim pie As Steema.TeeChart.Styles.Pie
    Dim ch1 As Steema.TeeChart.TChart
    Private Sub Initializechart()
        ch1 = New Steema.TeeChart.TChart()
        Me.Controls.Add(ch1)
        pie = New Pie(ch1.Chart)
        pie.FillSampleValues(10)
        ch1.Legend.Alignment = Steema.TeeChart.LegendAlignments.Bottom
        ch1.Legend.MaxNumRows = 5
    End Sub
Could you tell us if previous code works in your end?

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

Fulcrum
Newbie
Newbie
Posts: 35
Joined: Fri Dec 21, 2012 12:00 am

Re: Legend

Post by Fulcrum » Wed Jun 26, 2013 12:08 pm

Hello Sandra,

with this propertie the legend only show 5 of the parts, and the rest dissapears

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

Re: Legend

Post by Sandra » Wed Jun 26, 2013 3:17 pm

Hello Fulcrum,
with this propertie the legend only show 5 of the parts, and the rest dissapears
No, The property MaxNumRows sets the Maximum number of Legend Rows displayed for a horizontal (Chart Top or Bottom) Legend. Therefore, for example,If you there are 20 values and you want two columns you need set the property MaxNumRows for example 10, because appears all the values.

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

Fulcrum
Newbie
Newbie
Posts: 35
Joined: Fri Dec 21, 2012 12:00 am

Re: Legend

Post by Fulcrum » Thu Jun 27, 2013 9:16 am

I have probed it and only shows 5 parts

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

Re: Legend

Post by Sandra » Thu Jun 27, 2013 2:06 pm

Hello Fulcrum,

How many values do you have?

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

Fulcrum
Newbie
Newbie
Posts: 35
Joined: Fri Dec 21, 2012 12:00 am

Re: Legend

Post by Fulcrum » Fri Jun 28, 2013 7:53 am

i have 10 values

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

Re: Legend

Post by Sandra » Fri Jun 28, 2013 11:06 am

Hello Fulcrum,

Using next code, where I have used 10 values and Legend.MaxNumRows = 5:

Code: Select all

    Public Sub New()
        ' This call is required by the designer.
        InitializeComponent()
        InitializeChart()
        ' Add any initialization after the InitializeComponent() call.
    End Sub
    Dim pie As Steema.TeeChart.Styles.Pie
    Dim ch1 As Steema.TeeChart.TChart

    Private Sub Initializechart()
        ch1 = New Steema.TeeChart.TChart()
        Me.Controls.Add(ch1)
        pie = New Pie(ch1.Chart)
        pie.FillSampleValues(10)
        ch1.Legend.Alignment = Steema.TeeChart.LegendAlignments.Bottom
        ch1.Legend.MaxNumRows = 5
    End Sub
I have gotten next results:
PieChart2LegendColumns5Rows.jpg
PieChart2LegendColumns5Rows.jpg (34.45 KiB) Viewed 10503 times
As you see, I have a legend with two columns but 5 rows. Could you please tell us, if the result image is correct for you? If you consider isn't correct, would be very grateful if you can tell us, why.


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

Post Reply