Change Background color

TeeChart for ActiveX, COM and ASP
Post Reply
Lopes
Newbie
Newbie
Posts: 12
Joined: Wed Sep 12, 2007 12:00 am

Change Background color

Post by Lopes » Tue Sep 18, 2007 7:54 pm

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

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

Post by Yeray » Wed Sep 19, 2007 7:40 am

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
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