Colorbands

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Agrilink
Newbie
Newbie
Posts: 38
Joined: Thu Feb 02, 2006 12:00 am

Colorbands

Post by Agrilink » Wed Feb 15, 2006 4:15 am

Hi,

I'm trying to set a color band on a chart.

For testing purposes I'm using code straight out of the tutorials:

AreaSeries area1 = new AreaSeries(tChart1.Chart);
ColorBand colorband1 = new ColorBand(tChart1.Chart); tChart1.Aspect.View3D = false;
tChart1.Panel.Gradient.Visible = true; tChart1.Panel.Gradient.StartColor = Color.Blue; tChart1.Panel.Gradient.MiddleColor = Color.Gray; tChart1.Panel.Gradient.EndColor = Color.Green;

area1.LinePen.Color = Color.Blue;
area1.FillSampleValues(20);

double offSet = area1.YValues.Maximum * 0.1;
colorband1.Active = true;
colorband1.Axis = tChart1.Axes.Left;
colorband1.Transparency = 50;
colorband1.Start = area1.YValues.Minimum + offSet; colorband1.End = area1.YValues.Maximum - offSet; colorband1.DrawBehind = false;

However, when I run the code it's giving me an "Object reference not set to an instance of an object." exception when trying to set the Transparency property.

Any ideas?

Thanks in advance.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Feb 15, 2006 10:37 am

Hi Agrilink,

Which TeeChart version are you using?

It works fine for me here using the code below with latest TeeChart for .NET v2 release and adding Steema.TeeChart.Styles and Steema.TeeChart.Tools namespaces to the form.

Code: Select all

		private void Form1_Load(object sender, System.EventArgs e)
		{
			Area area1 = new Area(tChart1.Chart); 			
			ColorBand colorband1 = new ColorBand(tChart1.Chart); 
			tChart1.Aspect.View3D = false; 
			tChart1.Panel.Gradient.Visible = true; 
			tChart1.Panel.Gradient.StartColor = Color.Blue; 
			tChart1.Panel.Gradient.MiddleColor = Color.Gray; 
			tChart1.Panel.Gradient.EndColor = Color.Green; 

			area1.LinePen.Color = Color.Blue; 
			area1.FillSampleValues(20); 

			double offSet = area1.YValues.Maximum * 0.1; 
			colorband1.Active = true; 
			colorband1.Axis = tChart1.Axes.Left; 
			colorband1.Transparency = 50; 
			colorband1.Start = area1.YValues.Minimum + offSet; 
			colorband1.End = area1.YValues.Maximum - offSet; 
			colorband1.DrawBehind = false;
		}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Agrilink
Newbie
Newbie
Posts: 38
Joined: Thu Feb 02, 2006 12:00 am

Post by Agrilink » Wed Feb 15, 2006 9:45 pm

Hi Narcis,

We have recently purchased TeeChart Pro v2 for Visual Studio .NET.

I have the appropriate namespaces added to my form.

I have tried executing the code in the form_load event and on a button click but the same error occurs when trying to set the transparency property.

Could this be a bug in the software?

What would be a work around?

Could I use ColorLines and draw them at the specific points on the y-axis, and set a specific color at either side of the lines? However I still need to display my LineSeries.

Any help and/or sample code would be appreciated.

Thanks.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Feb 16, 2006 10:10 am

Hi Agrilink,

It's strange because it works here for me. Could you please send us an example we can run "as-is" to reproduce your problem here?

You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Agrilink
Newbie
Newbie
Posts: 38
Joined: Thu Feb 02, 2006 12:00 am

Post by Agrilink » Fri Feb 17, 2006 1:29 am

Hi Narcis,

I tried sending a sample project to your newsgroup, but it gave me an error:

"The message could not be sent.

No sender was specified. Please check your News Account configuration."

Is there an email address I can send it to?

Thanks.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Feb 17, 2006 11:21 am

Hi Agrilink,

This may be because you need to set up your user information (your name, e-mail address, etc.). If you don't want to disclose your identity you can use a nick and an invented e-mail address.

If the problem persists please let me know and we will try to find a solution to it.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Agrilink
Newbie
Newbie
Posts: 38
Joined: Thu Feb 02, 2006 12:00 am

Post by Agrilink » Sun Feb 19, 2006 10:52 pm

Hi Narcis,

I've checked my profile and my email address is specified.

Is this what you call my "user information"?

Note, the software wasn't actually purchased in my name. I just registered to the forum with my own details.

But I still can't post a sample app to your newsgroup.

Thanks.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Feb 20, 2006 9:33 am

Hi Agrilink,
I've checked my profile and my email address is specified.

Is this what you call my "user information"?
Yes.
Note, the software wasn't actually purchased in my name. I just registered to the forum with my own details.

But I still can't post a sample app to your newsgroup.
It doesn't matter. Everybody is able to post in our public forums. Nevermind, send the example directly to me.
Last edited by Narcís on Wed Oct 04, 2006 11:20 am, edited 1 time in total.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Feb 21, 2006 2:58 pm

Hi Agrilink,

Thanks for the example.

I’ve been able to reproduce the problem here and checked that it works fine with our current sources so it should work fine using the latest Debug Build version released yesterday. Could you please download that version and check if it works at your end?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Agrilink
Newbie
Newbie
Posts: 38
Joined: Thu Feb 02, 2006 12:00 am

Post by Agrilink » Wed Feb 22, 2006 6:10 am

Hi Narcis,

The only update I see in the Customer Downloads is the December 2005 build.

Am I looking in the right place?

Thanks.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Feb 22, 2006 8:34 am

Hi Agrilink,

You should look below. First there are 22nd December 2005 installers for VS2003 and VS2005 and after them you'll find the Debug build from 20th February 2006 which I mentioned.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Agrilink
Newbie
Newbie
Posts: 38
Joined: Thu Feb 02, 2006 12:00 am

Post by Agrilink » Wed Feb 22, 2006 9:36 pm

Hi Narcis,

Thanks for your help.

That interim build version fixed the problem.

Any idea when we can expect a production maintenance release?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Feb 23, 2006 10:25 am

Hi Agrilink,

You're welcome. I'm glad to hear it works.

There's no date fixed for the next maintenance release yet. But according to our release policy it should be out in a one or two month period.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply