Program stops when drawing chart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
zeus
Newbie
Newbie
Posts: 9
Joined: Wed May 23, 2007 12:00 am
Contact:

Program stops when drawing chart

Post by zeus » Mon Jul 27, 2009 6:40 am

hello

I think there is a problem when drawing chart in some case.

You can experience this bug by following instructions below.

1. Create TeeChart control and add fastline series.
2. Edit the data of fastline.
3. Set first value to 851.17190000000051 and set other values to 851.1719
4. then.. your visual studio will stop.

I suffered for this bug during last 2 days. ToT

reply, please.

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

Re: Program stops when drawing chart

Post by Narcís » Mon Jul 27, 2009 9:05 am

Hello zeus,

I'm not able to reproduce the issue here. Coud you please answer a few questions so that we can recreate the problem?

1. Which Visual Studio version are you using?
2. Which exact TeeChart version you are using?
3. Does this only occurs at designtime?
4. Should FastLine values set to any specific format?

Any detail you feel it's relevant to reproduce the issue here will be welcome.

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
Image Image Image Image Image Image
Instructions - How to post in this forum

zeus
Newbie
Newbie
Posts: 9
Joined: Wed May 23, 2007 12:00 am
Contact:

Re: Program stops when drawing chart

Post by zeus » Tue Jul 28, 2009 12:51 am

Thanks for your reply :)

1. I use VS2008. version 9.0.30729.1 SP
2. Latest version 3.5.3470.15475
3. I think it occurs whenever try to draw chart. It also occurs when export chart to image file.
4. I don't think so. I set the format to default value.

I suppose that the range of left axis causes this error.
It also occurs when set left axis maximum and minimum to 851.17190000000051 and 851.1719

I'm sorry that I'm not good at English writing.

Thank you for your kindness.

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

Re: Program stops when drawing chart

Post by Narcís » Tue Jul 28, 2009 11:10 am

Hi zeus,

Thanks for the information.
I suppose that the range of left axis causes this error.
It also occurs when set left axis maximum and minimum to 851.17190000000051 and 851.1719
Are setting those values to left axis' minimum and maximum properties? The problem could be that minimum value needs to be smaller or equal to the maximum value. However, there seems to be a problem setting axis values as you mentioned as code below freezes chart rendering. Can you please confirm code below is the problem you are experiencing?

Code: Select all

			Steema.TeeChart.Styles.FastLine fastLine1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
			fastLine1.FillSampleValues();

			double min = 851.1719;
			double max = 851.17190000000051;

			tChart1.Axes.Left.SetMinMax(min, max);
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
Image Image Image Image Image Image
Instructions - How to post in this forum

zeus
Newbie
Newbie
Posts: 9
Joined: Wed May 23, 2007 12:00 am
Contact:

Re: Program stops when drawing chart

Post by zeus » Thu Jul 30, 2009 12:51 am

Yes, exactly~

That code is the problem that I am experienced.

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

Re: Program stops when drawing chart

Post by Narcís » Thu Jul 30, 2009 7:16 am

Hi zeus,

Thanks for your feedback. I' ve added the issue to the defect list (TF02014328) to be fixed for next releases.
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

zeus
Newbie
Newbie
Posts: 9
Joined: Wed May 23, 2007 12:00 am
Contact:

Re: Program stops when drawing chart

Post by zeus » Thu Jul 30, 2009 8:35 am

Thanks very much :-)

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

Re: Program stops when drawing chart

Post by Narcís » Mon Aug 24, 2009 7:51 am

Hi zeus,

After investigating the issue further we found that the issue is that the value max in your example is outside the range of precision for a .NET Framework double number. You can see this by running the code:

Code: Select all

double max = 851.17190000000051;
MessageBox.Show(max.ToString());
you can see that the string representation shows "851,171900000001", a number different to max but one which is within the precision range for double. So, using the code:

Code: Select all

      double min = 851.1719;
      //double max = 851.17190000000051;
      double max = 851.171900000001;
      tChart1.Axes.Left.SetMinMax(min, max);
now works fine. Please make sure the numbers you use in your examples are within the range for value type you are using.
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

zeus
Newbie
Newbie
Posts: 9
Joined: Wed May 23, 2007 12:00 am
Contact:

Re: Program stops when drawing chart

Post by zeus » Mon Aug 24, 2009 9:04 am

in .NET
851.17190000000051 represents to 851.171900000001

but in TeeChart
program stops.


what's the problem?

If I set the max value to 851.17190000000051
then set the max value to 851.171900000001 rather then stop the program.

It is no problem that 851.17190000000051 changes to 851.171900000001
but It is a big problem that server program stops forever.
No matter what the value is, the program must not be frozen.

Although I can modify my code not to occur that problem again, I don't want to modify my all code to use teechart.

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

Re: Program stops when drawing chart

Post by Narcís » Mon Aug 24, 2009 11:11 am

Hi zeus,

Using this code:

Code: Select all

			Steema.TeeChart.Styles.FastLine fastLine1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
			fastLine1.FillSampleValues();

			double min = 851.1719;
			//double max = 851.17190000000051;
			double max = 851.171900000001;
			tChart1.Axes.Left.SetMinMax(min, max);
With latest TeeChart for .NET v3 and v2009 releases works fine for me here. Can you please if this works fine at your end?

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
Image Image Image Image Image Image
Instructions - How to post in this forum

zeus
Newbie
Newbie
Posts: 9
Joined: Wed May 23, 2007 12:00 am
Contact:

Re: Program stops when drawing chart

Post by zeus » Mon Aug 24, 2009 11:53 am

OK

the code works fine.

when will it be fixed?

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Program stops when drawing chart

Post by Yeray » Thu Aug 27, 2009 10:31 am

Hi zeus,

As Narcís explained, this is a .NET Framework limitation, not a TeeChart bug. We consider that TeeChart is drawing the correct values. I'm afraid that your program should validate your data, which the .NET Framework will round, before giving it to the chart.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

zeus
Newbie
Newbie
Posts: 9
Joined: Wed May 23, 2007 12:00 am
Contact:

Re: Program stops when drawing chart

Post by zeus » Tue Sep 01, 2009 1:02 am

Hi Yeray

Have you read article below?

The bug which I mentioned is "Application Stopping"
Your library cause Freezing my application

And Narcis request me to change my code.
I want to ask you.
Is that my fault?

I think that there are three ways to solve the problem

1. change .NET code
2. change TeeChart code
3. change my code

Have you consider about solution 1 or 2 ?
in .NET
851.17190000000051 represents to 851.171900000001

but in TeeChart
program stops.


what's the problem?

If I set the max value to 851.17190000000051
then set the max value to 851.171900000001 rather then stop the program.

It is no problem that 851.17190000000051 changes to 851.171900000001
but It is a big problem that server program stops forever.
No matter what the value is, the program must not be frozen.

Although I can modify my code not to occur that problem again, I don't want to modify my all code to use teechart.
in .NET
851.17190000000051 represents to 851.171900000001

but in TeeChart
program stops.


what's the problem?

If I set the max value to 851.17190000000051
then set the max value to 851.171900000001 rather then stop the program.

It is no problem that 851.17190000000051 changes to 851.171900000001
but It is a big problem that server program stops forever.
No matter what the value is, the program must not be frozen.

Although I can modify my code not to occur that problem again, I don't want to modify my all code to use teechart.

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

Re: Program stops when drawing chart

Post by Narcís » Wed Sep 09, 2009 10:09 am

Hello zeus,

We have been investigating the issue and finally found a solution which has been implemented for next maintenance release.
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

zeus
Newbie
Newbie
Posts: 9
Joined: Wed May 23, 2007 12:00 am
Contact:

Re: Program stops when drawing chart

Post by zeus » Thu Sep 10, 2009 12:49 am

Good job ^^

Thank you~

Post Reply