Page 1 of 1

Modify Background

Posted: Fri Nov 19, 2010 2:13 pm
by 15657291
Hello
Does anyone know, how I can modify the background of my TChart?
I want to color the range 0-10 (X-Value) in blue, the range 10-90 (X-Value) in dark blue and the range 90-100 (X-Value) in black.

I didn't really find information about this in the internet or the tutorials...
Thanks a lot !!

Re: Modify Background

Posted: Fri Nov 19, 2010 3:43 pm
by 10050769
Hello ICS,

I recommend two options for change color of your TChart background:

First: Using property Gradient of Chart Panel and Chart Walls as do in next lines of code:

Code: Select all

  tChart1.Panel.Gradient.StartColor = Color.White;
          tChart1.Panel.Gradient.MiddleColor = Color.Blue;
          tChart1.Panel.Gradient.EndColor = Color.Black;
          tChart1.Walls.Back.Gradient.StartColor = Color.White;
          tChart1.Walls.Back.Gradient.MiddleColor = Color.Blue;
          tChart1.Walls.Back.Gradient.EndColor = Color.Black;

Second:
Using property Gradient of Chart Panel and change property visible of Walls to false, as do below:

Code: Select all

          tChart1.Panel.Gradient.StartColor = Color.White;
          tChart1.Panel.Gradient.MiddleColor = Color.Blue;
          tChart1.Panel.Gradient.EndColor = Color.Black;
          tChart1.Walls.Back.Visible = false;
I hope will helps.

Thanks,

Re: Modify Background

Posted: Fri Nov 19, 2010 5:30 pm
by yeray
Hi ICS,

You could use Color Band tools to do it. Take a look at the example at All Features\Welcome !\Tools\Color Band.
You'll find this and many other examples in the Feature demo included with the installation. A shortcut to it can be found in the StartMenu, in TeeChart programs group.

Re: Modify Background

Posted: Mon Nov 22, 2010 11:11 am
by 15657291
Hola
Gracias for the answer.
I added a color band. This is exactly what I needed :-)
I couldn't use the "panel.gradient", because I need a defined line. In the Gradient, the color change is half transperant.

Hasta luego
Eric

Re: Modify Background

Posted: Mon Nov 22, 2010 1:49 pm
by yeray
Hola Eric,

You're welcome.
Salut! :D