Hi everyone. I created a simple teechart that has an x and y axis. I plot the numbers below, but i receive an error.
fastLine1.Add(1.0,3.3691226157562149);
fastLine1.Add(2.0,3.3691226157562149);
fastLine1.Add(3.0,3.3691226157562149);
fastLine1.Add(4.0,3.3691226157562149);
fastLine1.Add(5.0,3.3691226157562153);
The points are really small, but I don't think it should be crashing. All of the settings for teechart are the default ones when you add the component to a C# project.
If anyone has any solutions for me or knows that this is an issue with teechart please let me know. I'm writing an application that needs very high precision, so this error behavior has been common for me so far. A solution is very important for me.
Thanks in advance,
Chris
IndexOutOfRangeException?
Hi, Chris.
Tol avoid FP errors minimum axis range and axis increments are limited to 1.e-10 and 1.0e-12. If you're plotting smaller values then TeeChart will (when calculating axis limit) ignore them and use these two limiting values. Looking at your data it looks like the difference is on the scale of 1.0e-15 so they are well below these two limits (also close to double precision). Workarounds:
1) If you have NET sources, edit Axis.cs unit and change these two constants:
private const double minAxisIncrement = 0.000000000001;
private const double minAxisRange = 0.0000000001;
to smaller values. This is untested solution because you might end up with FP error.
2) Plot only difference, multiplied with appropriate decade factor. Example:
Tol avoid FP errors minimum axis range and axis increments are limited to 1.e-10 and 1.0e-12. If you're plotting smaller values then TeeChart will (when calculating axis limit) ignore them and use these two limiting values. Looking at your data it looks like the difference is on the scale of 1.0e-15 so they are well below these two limits (also close to double precision). Workarounds:
1) If you have NET sources, edit Axis.cs unit and change these two constants:
private const double minAxisIncrement = 0.000000000001;
private const double minAxisRange = 0.0000000001;
to smaller values. This is untested solution because you might end up with FP error.
2) Plot only difference, multiplied with appropriate decade factor. Example:
Code: Select all
fastLine1.Add(1.0,149);
fastLine1.Add(2.0,149);
fastLine1.Add(3.0,149);
fastLine1.Add(4.0,149);
fastLine1.Add(5.0,153);
fastLine1.GetVertAxis.Title.Text = "3.3691226157562 + value x 1e-15";
Marjan Slatinek,
http://www.steema.com
http://www.steema.com