Deriving custom series and custom drawing

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
PoLabs
Newbie
Newbie
Posts: 17
Joined: Mon Sep 01, 2014 12:00 am

Deriving custom series and custom drawing

Post by PoLabs » Wed Sep 03, 2014 10:13 am

Hi,

we've just updated our license to 2014 Pro with sources. Main reason for that is because I need to develop custom series with some customized drawing which is by default not supported from TeeChart. I would like to start with deriving my custom series but I am not sure which class should I take to derive my custom series from.

Now we are using TFastLineSeries which was the best solution for us so far. Now I would like to do some custom drawing and I notice in sources that TFastLine is calling Polyline to draw point. This is not an option for us. We will have to manipulate every point in series and decide how to draw it according to surrounding points. So there will be a mixture of drawing each point, more points etc... What would be your suggestion?

I guess I will have to override DrawAllPoints procedure and do drawing there. How can I retrieve Chart properties and canvas size etc...to get proper dimensions, scaling, offset etc?

Thank you in advance,
Kind regards
Aljosa

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

Re: Deriving custom series and custom drawing

Post by Yeray » Wed Sep 03, 2014 12:46 pm

Hi Aljosa,
PoLabs wrote:we've just updated our license to 2014 Pro with sources. Main reason for that is because I need to develop custom series with some customized drawing which is by default not supported from TeeChart. I would like to start with deriving my custom series but I am not sure which class should I take to derive my custom series from.
Note you don't need the TeeChart sources to inherit from a series and modify its behaviour/drawing procedures to make it look as you wish. However, I understand full sources are always useful in situations like yours.
PoLabs wrote:Now we are using TFastLineSeries which was the best solution for us so far. Now I would like to do some custom drawing and I notice in sources that TFastLine is calling Polyline to draw point. This is not an option for us. We will have to manipulate every point in series and decide how to draw it according to surrounding points. So there will be a mixture of drawing each point, more points etc... What would be your suggestion?
By default, TFastLineSeries isn't using Polyline. This technique is faster than drawing segment by segment, but you have to set DrawStyle property to flAll to activate it (by default it's flSegments).
PoLabs wrote:I guess I will have to override DrawAllPoints procedure and do drawing there. How can I retrieve Chart properties and canvas size etc...to get proper dimensions, scaling, offset etc?
If you want to draw something next to each point, you could override TFastLineSeries.DrawValue method instead of TFastLineSeries.DrawAllValues.
As you'll see in the sources, this method starts calculating the X,Y coordinates in pixels for the given ValueIndex (CalcPosition). So it shouldn't be difficult to draw something else relative to these X,Y coordinates.

Don't hesitate to let us know if you still find problems with it.
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