legend with checkbox style
Re: legend with checkbox style
thanx.. where exactly i need to paste this code ( i mean in which event/procedure)...it will be great if you can send the whole code taht works for u..
Re: legend with checkbox style
Hi shikha,
I've simply modified the code you've sent to us by adding the mentioned code at the end of your InitializeChart method. Here is the whole code (cleaned of commented code):
I've simply modified the code you've sent to us by adding the mentioned code at the end of your InitializeChart method. Here is the whole code (cleaned of commented code):
Code: Select all
Public Class Form1
Public Sub New()
InitializeComponent()
InitializeChart()
End Sub
Private Sub InitializeChart()
TChart1.Aspect.View3D = False
Dim barSeriesBase As Steema.TeeChart.Styles.Bar
barSeriesBase = New Steema.TeeChart.Styles.Bar
barSeriesBase.Add(123, "A")
barSeriesBase.Add(456, "dr")
barSeriesBase.Add(321, "rea")
TChart1.Series.Add(barSeriesBase)
barSeriesBase.MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked
TChart1.Series.Add(New Steema.TeeChart.Styles.Bar())
TChart1.Series(1).Clear()
TChart1.Series(1).Add(221, "cd")
TChart1.Series(1).Add(456, "bg")
TChart1.Series(1).Add(321, "rea")
TChart1.Series.Add(New Steema.TeeChart.Styles.Bar())
TChart1.Series(2).Clear()
TChart1.Series(2).Add(100, "csd")
TChart1.Series(2).Add(456, "bsg")
TChart1.Series(2).Add(321, "resa")
TChart1.Legend.CheckBoxes = True
TChart1.Legend.LegendStyle = Steema.TeeChart.LegendStyles.Series
' force a first repaint to set minimum and maximum for the axes
TChart1.Draw()
' now you can force the axis not to move
TChart1.Axes.Left.Automatic = False
TChart1.Axes.Bottom.Automatic = False
' you could add a dummy series (series without data) to force axis to be always drawn
TChart1.Series.Add(New Steema.TeeChart.Styles.Bar())
TChart1.Series(TChart1.Series.Count - 1).ShowInLegend = False
' you should finally clear the bottom axis labels and draw the ones you wish
TChart1.Axes.Bottom.Labels.Items.Clear()
TChart1.Axes.Bottom.Labels.Items.Add(0, "label 1")
TChart1.Axes.Bottom.Labels.Items.Add(1, "label 2")
TChart1.Axes.Bottom.Labels.Items.Add(2, "label 3")
End Sub
End Class
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: legend with checkbox style
EXCELLENT!!! this worked!! THANKS SO MUCH ..........................