Custom mark position

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Eic
Newbie
Newbie
Posts: 18
Joined: Mon Apr 18, 2016 12:00 am

Custom mark position

Post by Eic » Fri Apr 22, 2016 7:57 am

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.

Yeray
Site Admin
Site Admin
Posts: 9534
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Custom mark position

Post by Yeray » Fri Apr 22, 2016 10:23 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Eic
Newbie
Newbie
Posts: 18
Joined: Mon Apr 18, 2016 12:00 am

Re: Custom mark position

Post by Eic » Fri Apr 22, 2016 11:59 am

The other post was talking about Series->OnAfterDrawValues event.

This works in the event Chart->OnAfterDraw.

My problem is solved, thank you.

Yeray
Site Admin
Site Admin
Posts: 9534
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Custom mark position

Post by Yeray » Fri Apr 22, 2016 2:42 pm

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();
}
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply