Page 1 of 1

Legend items vertically ordered ?

Posted: Fri May 21, 2004 5:19 pm
by 9336586
Is there a way to align the legend items vertically ? I have a legend at the bottom of the chart, with three columns. I'd like to get the legend items in vertical order, instead of horizontally.

As an example, I'd like something like
1 4 7
2 5 8
3 6 9

I'm using Teechart 6

Bruno

Posted: Sun May 23, 2004 5:25 pm
by Pep
Hi Bruno,

there's no way to do this autmatically, but this can be done using the canvas techniques. You can see on example of use in the TeeChart Pro Demo features project under :
All Features -> Welcome -> Miscellaneous -> Legend -> Dawing more text

Posted: Mon May 24, 2004 12:12 pm
by 8572644
I've thoght of this, but I have another problem. Later I need the legend the mouse is over in OnMouseMove:

(Sender AS TChart).CalcClickedPart(Point(X, Y), Part);
IF Part.PointIndex >= (Sender AS TChart).Series[0].Count THEN
Exit;
IF Part.Part = cpLegend THEN
FCurrSlice := Part.PointIndex

This will make Part.PointIndex point to the wrong slice, no ?

Bruno

What about using OnGetLegendPos?

Posted: Thu Oct 28, 2004 8:00 am
by 8442780
You can alter the X and Y coordinates for each Legend item within the LegendRect (found from OnGetLegendRect event)

Look up help on the OnGetLegendPos event

HTH :roll: