I have added my series in a particular order so that they draw correctly, however that isn't the order I'd like them to display in the chart legend.
So is it possible to control the series order in the legend without changing the order of th series themselves?
Legend Series Order
Hi LVL,
I'm afraid that the feature you doesn't exist. But there are others that you may haven't seen such as OnGetLegendText and OnLegendDrawSymbol events. And also...
You can hide a series to be shown:
Or you could simply invert the legend items order:
Finally, you always could customize your legend at maximum drawing directly to the canvas what you want.
I'm afraid that the feature you doesn't exist. But there are others that you may haven't seen such as OnGetLegendText and OnLegendDrawSymbol events. And also...
You can hide a series to be shown:
Code: Select all
TChart1.Series(0).ShowInLegend = False
Code: Select all
TChart1.Legend.Inverted = True
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi,
Here is a portion of code showing how you could draw a custom legend directly to the canvas. Only to show how you could also do it.
Here is a portion of code showing how you could draw a custom legend directly to the canvas. Only to show how you could also do it.
Code: Select all
Private Sub TChart1_OnAfterDraw()
With TChart1.Canvas
'legend rect
.Rectangle TChart1.ChartBounds.Right - 85, 100, TChart1.ChartBounds.Right - 15, 200
'series 1
.Brush.Color = TChart1.Series(0).Color
.Rectangle TChart1.ChartBounds.Right - 80, 107, TChart1.ChartBounds.Right - 70, 117
.Brush.Color = vbWhite
.TextOut TChart1.ChartBounds.Right - 65, 105, "Series 1"
'series 2
'...
End With
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |