Page 1 of 1

Program stops when drawing chart

Posted: Mon Jul 27, 2009 6:40 am
by 13045248
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.

Re: Program stops when drawing chart

Posted: Mon Jul 27, 2009 9:05 am
by narcis
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.

Re: Program stops when drawing chart

Posted: Tue Jul 28, 2009 12:51 am
by 13045248
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.

Re: Program stops when drawing chart

Posted: Tue Jul 28, 2009 11:10 am
by narcis
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.

Re: Program stops when drawing chart

Posted: Thu Jul 30, 2009 12:51 am
by 13045248
Yes, exactly~

That code is the problem that I am experienced.

Re: Program stops when drawing chart

Posted: Thu Jul 30, 2009 7:16 am
by narcis
Hi zeus,

Thanks for your feedback. I' ve added the issue to the defect list (TF02014328) to be fixed for next releases.

Re: Program stops when drawing chart

Posted: Thu Jul 30, 2009 8:35 am
by 13045248
Thanks very much :-)

Re: Program stops when drawing chart

Posted: Mon Aug 24, 2009 7:51 am
by narcis
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.

Re: Program stops when drawing chart

Posted: Mon Aug 24, 2009 9:04 am
by 13045248
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.

Re: Program stops when drawing chart

Posted: Mon Aug 24, 2009 11:11 am
by narcis
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.

Re: Program stops when drawing chart

Posted: Mon Aug 24, 2009 11:53 am
by 13045248
OK

the code works fine.

when will it be fixed?

Re: Program stops when drawing chart

Posted: Thu Aug 27, 2009 10:31 am
by yeray
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.

Re: Program stops when drawing chart

Posted: Tue Sep 01, 2009 1:02 am
by 13045248
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.

Re: Program stops when drawing chart

Posted: Wed Sep 09, 2009 10:09 am
by narcis
Hello zeus,

We have been investigating the issue and finally found a solution which has been implemented for next maintenance release.

Re: Program stops when drawing chart

Posted: Thu Sep 10, 2009 12:49 am
by 13045248
Good job ^^

Thank you~