Page 1 of 1

Custom mark position

Posted: Fri Apr 22, 2016 7:57 am
by 16478065
Hello,
I started in the use of TChart. I want to customize the position of the marks.

One solution is described here: http://www.teechart.net/support/viewtop ... on+lefttop.

But in my case Series-> Marks->Positions->Count is 0 on AfterDrawValues event.

Le comportement a-t-il changé depuis la publication du post pré-cité ?

Thanks.

Re: Custom mark position

Posted: Fri Apr 22, 2016 10:23 am
by yeray
Bonjour,

I've tested this adding a TBarSeries to a new empty chart at design time; I've also added sample values to it.
Then I've implemented this simple OnAfterDraw event and it seems to work fine for me:

Code: Select all

void __fastcall TForm1::Chart1AfterDraw(TObject *Sender)
{
  Caption=Series1->Marks->Positions->Count;
}
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.

Re: Custom mark position

Posted: Fri Apr 22, 2016 11:59 am
by 16478065
The other post was talking about Series->OnAfterDrawValues event.

This works in the event Chart->OnAfterDraw.

My problem is solved, thank you.

Re: Custom mark position

Posted: Fri Apr 22, 2016 2:42 pm
by yeray
Hello,
Eic wrote:The other post was talking about Series->OnAfterDrawValues event.
Sorry, I misread it.
Forcing a Chart repaint at OnCreate solves the problem with calling Series1->Marks->Positions->Count at OnAfterDrawValues event. Ie:

Code: Select all

void __fastcall TForm1::FormCreate(TObject *Sender)
{
  Chart1->Draw();
}