TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
-
to2
- Newbie
- Posts: 25
- Joined: Thu Dec 03, 2009 12:00 am
Post
by to2 » Fri Aug 06, 2010 8:31 am
Hello,
I'd like to have all marks vertical (content readable from the right side) and attached to the upper border of the chart.
I've done the following:
- Series->Marks->Angle = 90
- In Series->AfterDrawValues
Code: Select all
int num_pos = Series->Marks->Positions->Count;
for (int i = 0; i < num_pos; ++i)
Series->Marks->Positions->Position[i]->LeftTop.y = 0;
Result: Marks are rotated but not aligned to upper chart border. How can I move the marks there?
CB2010, TC 8.06, Win7 32
-
Yeray
- Site Admin
- Posts: 9614
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Fri Aug 06, 2010 2:25 pm
Hi to2,
You also have to change the Custom property:
Code: Select all
Series->Marks->Positions->Position[i]->Custom = True;
If you still have troubles with it, don't hesitate to let us know.
-
to2
- Newbie
- Posts: 25
- Joined: Thu Dec 03, 2009 12:00 am
Post
by to2 » Mon Aug 09, 2010 6:59 am
You also have to change the Custom property:
I did so. 3 new problems occur:
- It seems as if the y=0 position is set when the mark is not rotated, after that the 90° rotation is performed around a center which is the center of the mark. Result: the marks don't have their LeftTop at y=0 but their "LeftCenter". The vertical center of the mark is at y=0 and the LeftTop is outside of the chart area.
- ArrowLength doesn't follow to the new position of mark.
- If I scroll the BottomAxis then marks and arrows don't follow to the new position of the series.
-
to2
- Newbie
- Posts: 25
- Joined: Thu Dec 03, 2009 12:00 am
Post
by to2 » Mon Aug 09, 2010 7:04 am
I wonder if I could get the desired behaviour by keeping Custom = false and modifying the ArrowLength of each mark instead. Is there an event fired, before a mark is drawn, so that I can calculate the mark dimensions and set the ArrowLength accordingly?
-
to2
- Newbie
- Posts: 25
- Joined: Thu Dec 03, 2009 12:00 am
Post
by to2 » Mon Aug 09, 2010 1:36 pm
What are
- TSeriesMarkPosition::MidPoint and
- TSeriesMarkPosition::HasMid
for? I can't find information about these properties in my online help.
-
to2
- Newbie
- Posts: 25
- Joined: Thu Dec 03, 2009 12:00 am
Post
by to2 » Mon Aug 09, 2010 5:18 pm
Got it working. Have to set many things (ArrowFrom, ArrowTo, LeftTop ...) manually. Have to consider that mark's width and height are measured before rotation. But finally it does what I want.
-
Yeray
- Site Admin
- Posts: 9614
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Tue Aug 10, 2010 8:28 am
Hi to2,
I'm glad to see you found it. If you still have any problem, regarding this or not, don't hesitate to let us know.