Page 1 of 1

Legend

Posted: Wed Jun 26, 2013 8:39 am
by 15664465
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

Re: Legend

Posted: Wed Jun 26, 2013 12:03 pm
by 10050769
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,

Re: Legend

Posted: Wed Jun 26, 2013 12:03 pm
by 10050769
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,

Re: Legend

Posted: Wed Jun 26, 2013 12:08 pm
by 15664465
Hello Sandra,

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

Re: Legend

Posted: Wed Jun 26, 2013 3:17 pm
by 10050769
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,

Re: Legend

Posted: Thu Jun 27, 2013 9:16 am
by 15664465
I have probed it and only shows 5 parts

Re: Legend

Posted: Thu Jun 27, 2013 2:06 pm
by 10050769
Hello Fulcrum,

How many values do you have?

Thanks,

Re: Legend

Posted: Fri Jun 28, 2013 7:53 am
by 15664465
i have 10 values

Re: Legend

Posted: Fri Jun 28, 2013 11:06 am
by 10050769
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 10501 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,