Custom series drawing

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
PoLabs
Newbie
Newbie
Posts: 35
Joined: Fri Feb 05, 2010 12:00 am

Custom series drawing

Post by PoLabs » Tue May 13, 2014 7:43 pm

Hi,

I need a series which combines at least three different series types (fast line, high-low and area line). It wouldn't be a problem if only one would be active at once but I need to combine "the best" of all three. So I was thinking about developing my own type of series with some custom drawing to chart. I would use base chart under it because it's nice with all features but I would draw data on it with my own methods and approaches.

My first step would be drawing first to a memory bitmap and later drawing that bitmap to chart canvas (graphics double-buffering). When I should draw on canvas? Should I do that when on After Draw Graph is called? What is the best approach to draw some custom graphics on your chart?

Thanks for your ideas.

Kind regards.

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

Re: Custom series drawing

Post by Yeray » Wed May 14, 2014 12:58 pm

Hello,
PoLabs wrote:My first step would be drawing first to a memory bitmap and later drawing that bitmap to chart canvas (graphics double-buffering). When I should draw on canvas? Should I do that when on After Draw Graph is called? What is the best approach to draw some custom graphics on your chart?
There are some different moments that could be interesting depending on your needs:

OnBeforeDrawChart event
OnBeforeDrawAxes event
OnBeforeDrawSeries event
OnAfterDraw event

Basically, choosing one or another will make some elements on the chart to be drawn over your image, or none.

Also note that, if you create your series inheriting from TChartSeries, you'll be able to add any instance of this class to your chart as any other series (calling the chart's AddSeries(const ASeries:TChartSeries) function), and then your series' DrawAllValues override will be called (between the chart's OnBeforeDrawSeries and OnAfterDraw events above).
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

PoLabs
Newbie
Newbie
Posts: 35
Joined: Fri Feb 05, 2010 12:00 am

Re: Custom series drawing

Post by PoLabs » Fri May 16, 2014 8:28 am

Thanks for fast reply and the idea. We will probably upgrade our license to Pro with source to see how it's done with existing series.

I am positively impressed with the rapidity and quality of your customer service as well. Keep on doing great work!

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

Re: Custom series drawing

Post by Yeray » Fri May 16, 2014 10:15 am

Hello,
PoLabs wrote:Thanks for fast reply and the idea. We will probably upgrade our license to Pro with source to see how it's done with existing series.

I am positively impressed with the rapidity and quality of your customer service as well. Keep on doing great work!
Thanks for the nice comments!
Don't hesitate to let us know if you find any problem
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