Page 1 of 1

Legend Transparency set in code causing runtime crash

Posted: Fri Feb 08, 2008 9:37 pm
by 9642375
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

Posted: Fri Feb 08, 2008 9:42 pm
by 9642375
Sorry,

chart1.Legend.Transparent = true;
chart1.Legend.Transparency = 100;

Posted: Tue Feb 12, 2008 9:27 am
by narcis
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.

Legend Problem

Posted: Tue Feb 12, 2008 11:21 pm
by 9642375
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

Posted: Wed Feb 13, 2008 11:07 am
by narcis
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.

Posted: Wed Feb 13, 2008 4:35 pm
by 9642375
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

Posted: Wed Feb 13, 2008 4:52 pm
by 9642375
Sorry, the PublicKeyToken has not changed. I will look into what else caused it not running.

Posted: Wed Feb 13, 2008 8:19 pm
by 9642375
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

Posted: Thu Feb 14, 2008 10:26 am
by narcis
Hi Michael,
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.
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.

Thanks in advance.

Color test

Posted: Thu Feb 14, 2008 9:09 pm
by 9642375
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

Posted: Thu Feb 14, 2008 9:12 pm
by 9642375
Uploaded as TeeChartLegendTest.rar

Posted: Fri Feb 15, 2008 11:12 am
by narcis
Hi Michael,

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;
Regarding footer, you need to add the following line:

Code: Select all

						chart1.Footer.Visible = true;
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.

Posted: Fri Feb 15, 2008 11:50 am
by narcis
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:

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;
You'll need to remove or comment in the code below as well.

Code: Select all

						//chart1.Series.Add(bar1);

						//chart1.Series.Add(fastLine1);
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.