Page 1 of 1

Change Background color

Posted: Tue Sep 18, 2007 7:54 pm
by 15046673
Hi NarcĂ­s,

I need change the background color, but I want put two colors.

example: My bottom axis is date time. Before 09/15/07 I want use white color and later 09/16/07 I want use red.

How Can I do this?

Thanks.
Igor

Posted: Wed Sep 19, 2007 7:40 am
by yeray
Hi Igor,

The easiest way could be using the ColorBand Tool. In the following example I used a TLineSeries with 10 values and I've drawn the ColorBand from the 7th value (index 6) to the last (index 9).

Code: Select all

  TChart1.Tools.Add tcColorband
  TChart1.Tools.Items(0).asColorband.Axis = TChart1.Axis.Bottom
  TChart1.Tools.Items(0).asColorband.Color = vbRed
  TChart1.Tools.Items(0).asColorband.DrawBehindAxes = True
  TChart1.Tools.Items(0).asColorband.StartValue = 6
  TChart1.Tools.Items(0).asColorband.EndValue = 9
  
  TChart1.Walls.Back.Transparent = False
  TChart1.Walls.Back.Color = vbWhite