Hi,
Can anyone provide a simple code example to place the legend inside and infront of the grid, located at the top-right corner of the grid?
I need it to stay there even when resizing the window/chart...
Legend position code
Hi,
you can use similar code to the following :
you can use similar code to the following :
Code: Select all
Private Sub Form_Load()
With TChart1
.AddSeries scLine
.Series(0).FillSampleValues (10)
.Legend.LegendStyle = lsSeries
.Legend.CustomPosition = True
.Axis.Top.Visible = True
.Aspect.View3D = False
.Environment.InternalRepaint
End With
End Sub
Private Sub TChart1_OnAfterDraw()
TChart1.Legend.Left = TChart1.Axis.Right.Position - (TChart1.Legend.ShapeBounds.Right - TChart1.Legend.ShapeBounds.Left)
TChart1.Legend.Top = TChart1.Axis.Top.Position
End Sub
Pep Jorge
http://support.steema.com
http://support.steema.com