Colorbands
Colorbands
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.
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.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
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.
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.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Agrilink,
Yes.I've checked my profile and my email address is specified.
Is this what you call my "user information"?
It doesn't matter. Everybody is able to post in our public forums. Nevermind, send the example directly to me.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.
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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?
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |