Legend
Posted: 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
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
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
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.with this propertie the legend only show 5 of the parts, and the rest dissapears
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