Page 1 of 1

Custom series drawing

Posted: Tue May 13, 2014 7:43 pm
by 10055200
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.

Re: Custom series drawing

Posted: Wed May 14, 2014 12:58 pm
by yeray
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).

Re: Custom series drawing

Posted: Fri May 16, 2014 8:28 am
by 10055200
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!

Re: Custom series drawing

Posted: Fri May 16, 2014 10:15 am
by yeray
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