Page 1 of 1
Colorbands
Posted: Wed Feb 15, 2006 4:15 am
by 9640166
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.
Posted: Wed Feb 15, 2006 10:37 am
by narcis
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;
}
Posted: Wed Feb 15, 2006 9:45 pm
by 9640166
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.
Posted: Thu Feb 16, 2006 10:10 am
by narcis
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.
Posted: Fri Feb 17, 2006 1:29 am
by 9640166
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.
Posted: Fri Feb 17, 2006 11:21 am
by narcis
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.
Posted: Sun Feb 19, 2006 10:52 pm
by 9640166
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.
Posted: Mon Feb 20, 2006 9:33 am
by narcis
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.
Posted: Tue Feb 21, 2006 2:58 pm
by narcis
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?
Posted: Wed Feb 22, 2006 6:10 am
by 9640166
Hi Narcis,
The only update I see in the Customer Downloads is the December 2005 build.
Am I looking in the right place?
Thanks.
Posted: Wed Feb 22, 2006 8:34 am
by narcis
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.
Posted: Wed Feb 22, 2006 9:36 pm
by 9640166
Hi Narcis,
Thanks for your help.
That interim build version fixed the problem.
Any idea when we can expect a production maintenance release?
Posted: Thu Feb 23, 2006 10:25 am
by narcis
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.