OnBeforeDrawSeries

TeeChart for ActiveX, COM and ASP
Post Reply
Vivo
Newbie
Newbie
Posts: 36
Joined: Fri Nov 26, 2004 5:00 am
Contact:

OnBeforeDrawSeries

Post by Vivo » Tue Jun 27, 2006 11:05 pm

How do I know which series is about to be drawn?

I though that it would be passed. I actually thought that I had seen it some where that it was, but I cannot seem to find that reference.

Thanks


Adrian

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Jun 28, 2006 10:08 am

Hi Adrian,

This event is called before the chart paints all series, as you can see in TeeChart's help:

BeforeDrawSeries event is called just before the Series points are painted.

WARNING:

Do not change Series properties that would force the Series to be repainted.

This may cause recursion and endless repainting !



What are you exactly trying to achieve with that? We can try to give you an alternative to achieve what you need.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Vivo
Newbie
Newbie
Posts: 36
Joined: Fri Nov 26, 2004 5:00 am
Contact:

Post by Vivo » Wed Jun 28, 2006 1:34 pm

I am trying to have a background for each axis that I can turn on and off at will.

Thanks,


Adrian

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Jun 28, 2006 1:46 pm

Hi Adrian,
I am trying to have a background for each axis that I can turn on and off at will.


Will this depend on the series visible on the Chart? Could you please be more explicit about what are you trying to achive?

BTW: Have you thought about using TeeChart's OnAfterDraw event? A TChart1.Environment.InternalRepaint call may be sometimes necessary to trigger the event.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Vivo
Newbie
Newbie
Posts: 36
Joined: Fri Nov 26, 2004 5:00 am
Contact:

Post by Vivo » Wed Jun 28, 2006 7:49 pm

Will this depend on the series visible on the Chart? Could you please be more explicit about what are you trying to achive?
I have multiple axes that I move around independently of each other. I wish to put a background on each. I have been trying to use the ColorBand, which would work sufficently for part of the application, but I would also want to display a box underneath series higer in the z order but above other series lower in the z order.

Example:

Code: Select all

I'm showing this in a code block as it uses a monospaced font.


            <--- Back of screen               Front of screen ---> 
                  Lower z-order               Higher z-order 

         Panel  axis-a   series-a   box-b axis-b   series-b   axis-c   series-c
       ^       ^       ^          ^              ^          ^        ^          ^
       |       |       |          |              |          |        |          |
      OBDC    OBDS    OBDS       OBDA           OBDS       OBDA     OBDS       OADC
NOTE: The arrows are to indicate where in the z-order the callback functions are called. The callback functions are as follows:
  • OBDC - OnBeforeDrawChart
    OBDA - OnBeforeDrawAxis
    OBDS - OnBeforeDrawSeries
    OADC - OnAfterDrawChart


I want box-b to be drawn after series-a but before axis-b. However, what I am getting from you is that the z-order is as follows:

Code: Select all

I'm showing this in a code block as it uses a monospaced font

              <--- Back of screen               Front of screen --->
                    Lower z-order               Higher z-order
  
            Panel   axis-a axis-b axis-c   series-a series-b series-c  
          ^       ^                      ^                            ^
          |       |                      |                            |
         OBDC    OBDA                   OBDS                         OADC
Which may be a problem.
BTW: Have you thought about using TeeChart's OnAfterDraw event? A TChart1.Environment.InternalRepaint call may be sometimes necessary to trigger the event.
I have thought of it but it will cause unwanted overlapping. Unless I cannot find any other way, I will have to rethink how this will be displayed. Do you have any other suggestions?

Thanks,


Adrian

Vivo
Newbie
Newbie
Posts: 36
Joined: Fri Nov 26, 2004 5:00 am
Contact:

Post by Vivo » Wed Jul 05, 2006 3:10 pm

Will someone please state if what I am saying in the previous post is right or wrong?

Thanks,


Adrian

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Jul 10, 2006 8:40 am

Hi Adrian,
I have multiple axes that I move around independently of each other. I wish to put a background on each. I have been trying to use the ColorBand, which would work sufficently for part of the application, but I would also want to display a box underneath series higer in the z order but above other series lower in the z order.
In that case, a trick could be to use a Shape series (with rectangle style), you can add it just before the series you want to keep on top (or change order when you want).

Post Reply