Colorize area between lines in graph

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
MMP
Newbie
Newbie
Posts: 11
Joined: Fri Nov 15, 2002 12:00 am
Location: Sweden
Contact:

Colorize area between lines in graph

Post by MMP » Thu Aug 19, 2004 9:39 am

I have two lines in a graph. I'd like to colorize the area between these lines, but I don't mange this. Please let me know how this is done.

Thank you!

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Thu Aug 19, 2004 10:42 am

Hi,
I have two lines in a graph. I'd like to colorize the area between these lines, but I don't mange this. Please let me know how this is done.
One suggestion would be to use a HighLow series, e.g.

Code: Select all

Steema.TeeChart.Styles.HighLow highLow1 = new Steema.TeeChart.Styles.HighLow(tChart1.Chart);
Random rnd = new Random();

for(double i=0; i<10; ++i) {
	highLow1.Add(i,rnd.Next(100),rnd.Next(10),""); 
}

highLow1.Pen.Visible = false;
highLow1.HighBrush.Visible = true;
highLow1.LowBrush.Visible = true;
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

MMP
Newbie
Newbie
Posts: 11
Joined: Fri Nov 15, 2002 12:00 am
Location: Sweden
Contact:

Post by MMP » Thu Aug 19, 2004 2:22 pm

Thanks! Worked fine!

But a new question popped up:

I'm made the HighPen and LowPen visible. Can I have the them in the legend instead of the little box? I want two lines (high and low pen) instead of the little box respresenting the HighLow area.

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Fri Aug 20, 2004 11:04 am

Hi,
I'm made the HighPen and LowPen visible. Can I have the them in the legend instead of the little box? I want two lines (high and low pen) instead of the little box respresenting the HighLow area.
You could try adding in dummy series like this:

Code: Select all

Steema.TeeChart.Styles.HighLow highLow1 = new Steema.TeeChart.Styles.HighLow(tChart1.Chart); 
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Steema.TeeChart.Styles.Line line2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);

Random rnd = new Random(); 

tChart1.Legend.Symbol.Squared = false;
tChart1.Legend.Symbol.WidthUnits = Steema.TeeChart.LegendSymbolSize.Pixels;
tChart1.Legend.Symbol.Width = 5;
tChart1.Aspect.View3D = false;

for(double i=0; i<10; ++i) { 
	highLow1.Add(i,rnd.Next(100),rnd.Next(10),""); 
} 

highLow1.Pen.Visible = false; 
highLow1.HighBrush.Visible = true; 
highLow1.LowBrush.Visible = true; 
highLow1.HighPen.Color = Color.Green;
highLow1.LowPen.Color = Color.Blue;
highLow1.ShowInLegend = false;

line1.Title = "High";
line2.Title = "Low";
line1.Color = Color.Green;
line2.Color = Color.Blue;
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

MMP
Newbie
Newbie
Posts: 11
Joined: Fri Nov 15, 2002 12:00 am
Location: Sweden
Contact:

Post by MMP » Fri Aug 20, 2004 12:38 pm

Great! That's one way to do it! It looks perfect! Thank you.

Post Reply