Page 1 of 1

OnBeforeDrawSeries

Posted: Tue Jun 27, 2006 11:05 pm
by 9525016
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

Posted: Wed Jun 28, 2006 10:08 am
by narcis
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.

Posted: Wed Jun 28, 2006 1:34 pm
by 9525016
I am trying to have a background for each axis that I can turn on and off at will.

Thanks,


Adrian

Posted: Wed Jun 28, 2006 1:46 pm
by narcis
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.

Posted: Wed Jun 28, 2006 7:49 pm
by 9525016
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

Posted: Wed Jul 05, 2006 3:10 pm
by 9525016
Will someone please state if what I am saying in the previous post is right or wrong?

Thanks,


Adrian

Posted: Mon Jul 10, 2006 8:40 am
by Pep
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).