Legend Transparency set in code causing runtime crash
-
- Newbie
- Posts: 11
- Joined: Fri Sep 01, 2006 12:00 am
Legend Transparency set in code causing runtime crash
Hi,
If I set:
chart1.Legend..Transparent = true;
chart1.Legend.Transparency = 100;
Then it has 95% of chance to have null reference exception from TeeChart and simply will not show anything. Even I add the code after the series have been added successfully, it still do the crash. Is this because the property is deeply inherited? Change it in the Editor using Legend - Format - Frame - Visible and Legend - Format - Color - Transparent is OK though. But I need to do it in the code!
Thanks,
Michael
If I set:
chart1.Legend..Transparent = true;
chart1.Legend.Transparency = 100;
Then it has 95% of chance to have null reference exception from TeeChart and simply will not show anything. Even I add the code after the series have been added successfully, it still do the crash. Is this because the property is deeply inherited? Change it in the Editor using Legend - Format - Frame - Visible and Legend - Format - Color - Transparent is OK though. But I need to do it in the code!
Thanks,
Michael
-
- Newbie
- Posts: 11
- Joined: Fri Sep 01, 2006 12:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Michael_Xu,
I'm not able to reproduce the problem here using latest TeeChart for .NET v3 release available at the client area. Which TeeChart version are you using? If the problem persists could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
I'm not able to reproduce the problem here using latest TeeChart for .NET v3 release available at the client area. Which TeeChart version are you using? If the problem persists could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
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 |
-
- Newbie
- Posts: 11
- Joined: Fri Sep 01, 2006 12:00 am
Legend Problem
Yes, the latest (eval) version runs OK with the test project (uploaded), the version has runtime crash was v2 (2.0.2306.26232). However, using the eval version, chart.DrawToBitmap() does not generate correctly, the bitmap is tiny and unviewable; if I use chart.Export.Image.PDF or JPEG .Save(), I can see a image with inverted colors.
Is this because it is eval version, or v3 fails at DrawToBitmap() ?
Please advise.
Thanks,
Michael
Is this because it is eval version, or v3 fails at DrawToBitmap() ?
Please advise.
Thanks,
Michael
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Michael,
As you can see in TeeChart for .NET v2 release notes, the version you use is quite an old one. I'm not able to reproduce the issue here using the version we posted yesterday at the client area. Could you please try if this version solves the problem at your end?
Regarding v3, this works fine for me here using Build 3.2.2945.19741, is this the same built you are using? The DrawToBitmap issue may be related to what I described here.
As you can see in TeeChart for .NET v2 release notes, the version you use is quite an old one. I'm not able to reproduce the issue here using the version we posted yesterday at the client area. Could you please try if this version solves the problem at your end?
Regarding v3, this works fine for me here using Build 3.2.2945.19741, is this the same built you are using? The DrawToBitmap issue may be related to what I described here.
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 |
-
- Newbie
- Posts: 11
- Joined: Fri Sep 01, 2006 12:00 am
Thanks, Narcis,
I just installed 2.0.2964.31902 (uninstalled the old v2, then the new full version of v2, then the updated). It seems that PublicKeyToken has changed so I cannot run. What is the new PublicKeyToken?
Thanks,
Michael
mxu@p2es.com
I just installed 2.0.2964.31902 (uninstalled the old v2, then the new full version of v2, then the updated). It seems that PublicKeyToken has changed so I cannot run. What is the new PublicKeyToken?
Thanks,
Michael
mxu@p2es.com
-
- Newbie
- Posts: 11
- Joined: Fri Sep 01, 2006 12:00 am
-
- Newbie
- Posts: 11
- Joined: Fri Sep 01, 2006 12:00 am
Narcis,
I found the reason why some old projects would not run:
User has to manually replace the DLLs in
Program Files\Steema Software\TeeChart for .NET v2
(version 2.0.2887.28040) with the ones in
Program Files\Steema Software\TeeChart for .NET v2 Update Build
(version 2.0.2964.31902)
As for v3, yesterday I downloaded the eval version (TeeChartNET3VSNET2005Eval.exe) from public access, not the client area, right click this TeeChartNET3VSNET2005Eval.exe I can found in Properties / Digital Signatures a timestamp of Jan 24, 2008 8:52:35 AM.
I found other problems with v3 yesterday, with the same code I wrote for v2, the footer did not show up in v3; I assigned (specified) colors for series, v3 shows the colors are not specified. So I uninstalled v3 earlier this morning.
Thanks,
Michael
I found the reason why some old projects would not run:
User has to manually replace the DLLs in
Program Files\Steema Software\TeeChart for .NET v2
(version 2.0.2887.28040) with the ones in
Program Files\Steema Software\TeeChart for .NET v2 Update Build
(version 2.0.2964.31902)
As for v3, yesterday I downloaded the eval version (TeeChartNET3VSNET2005Eval.exe) from public access, not the client area, right click this TeeChartNET3VSNET2005Eval.exe I can found in Properties / Digital Signatures a timestamp of Jan 24, 2008 8:52:35 AM.
I found other problems with v3 yesterday, with the same code I wrote for v2, the footer did not show up in v3; I assigned (specified) colors for series, v3 shows the colors are not specified. So I uninstalled v3 earlier this morning.
Thanks,
Michael
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Michael,
Thanks in advance.
Could you please also send us a simple example project we can run "as-is" to reproduce the problem here? We would try running it using latest v2 and v3 version and check if there are differences.I found other problems with v3 yesterday, with the same code I wrote for v2, the footer did not show up in v3; I assigned (specified) colors for series, v3 shows the colors are not specified. So I uninstalled v3 earlier this morning.
Thanks in advance.
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 |
-
- Newbie
- Posts: 11
- Joined: Fri Sep 01, 2006 12:00 am
Color test
Hi, Narcís,
The project I uploaded last time can be used for testing. I will upload again just in case.
bar1.Brush.Color = System.Drawing.Color.Gold;
fastLine1.Color = System.Drawing.Color.Blue;
Thanks,
Michael
The project I uploaded last time can be used for testing. I will upload again just in case.
bar1.Brush.Color = System.Drawing.Color.Gold;
fastLine1.Color = System.Drawing.Color.Blue;
Thanks,
Michael
-
- Newbie
- Posts: 11
- Joined: Fri Sep 01, 2006 12:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Michael,
Thanks for the example project. In v3, for series colors to work as you expect you need to use this:
Regarding footer, you need to add the following line:
I've checked that your original code worked in v2 so I've added this (TF02012821) to our defect list to have the same behavior in v3.
Thanks for the example project. In v3, for series colors to work as you expect you need to use this:
Code: Select all
bar1.Color = System.Drawing.Color.Gold;
Code: Select all
chart1.Footer.Visible = true;
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 Michael,
After reviewing the series colors issues we found that you need to add them to the chart's series colection before modifying their colors. Code below works fine in v3:
You'll need to remove or comment in the code below as well.
Regarding the footer problem, in v3 it is set to not visible by default. Both, the color and footer issues, had different behavior in v2 because of some serialization issues on that version.
After reviewing the series colors issues we found that you need to add them to the chart's series colection before modifying their colors. Code below works fine in v3:
Code: Select all
Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(chart1.Chart);
Steema.TeeChart.Styles.FastLine fastLine1 = new Steema.TeeChart.Styles.FastLine(chart1.Chart);
// bar1
bar1.Brush.Color = System.Drawing.Color.Gold;
//bar1.Color = System.Drawing.Color.Gold;
bar1.MultiBar = Steema.TeeChart.Styles.MultiBars.Stacked;
Code: Select all
//chart1.Series.Add(bar1);
//chart1.Series.Add(fastLine1);
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 |