Page 1 of 1
Marks, vertical and aligned to upper border of chart
Posted: Fri Aug 06, 2010 8:31 am
by 10554786
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
Re: Marks, vertical and aligned to upper border of chart
Posted: Fri Aug 06, 2010 2:25 pm
by yeray
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.
Re: Marks, vertical and aligned to upper border of chart
Posted: Mon Aug 09, 2010 6:59 am
by 10554786
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.
Re: Marks, vertical and aligned to upper border of chart
Posted: Mon Aug 09, 2010 7:04 am
by 10554786
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?
Re: Marks, vertical and aligned to upper border of chart
Posted: Mon Aug 09, 2010 1:36 pm
by 10554786
What are
- TSeriesMarkPosition::MidPoint and
- TSeriesMarkPosition::HasMid
for? I can't find information about these properties in my online help.
Re: Marks, vertical and aligned to upper border of chart
Posted: Mon Aug 09, 2010 5:18 pm
by 10554786
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.
Re: Marks, vertical and aligned to upper border of chart
Posted: Tue Aug 10, 2010 8:28 am
by yeray
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.