Hello,
I am using XamDataChart --> Line Series with CategoryDateTimeXAxis and NumericYAxis. Here I am receiving following error regularly while running automation scripts to open the Chart.
I am not sure multiplication of which values is getting out of Decimal range. Could you please have a look and let me know the values which are creating the issue here?
System.OverflowException: Value was either too large or too small for a Decimal.
at System.Decimal.FCallMultiply(Decimal& d1, Decimal& d2)
at Infragistics.Controls.Charts.AutoRangeCalculator.CalculateRange(NumericAxisBase target, Double userMinimum, Double userMaximum, Boolean isLogarithmic, Int32 logarithmBase, Double& minimumValue, Double& maximumValue)
at Infragistics.Controls.Charts.LinearScaler.CalculateRange(NumericAxisBase target, Double minimumValue, Double maximumValue, Double& actualMinimumValue, Double& actualMaximumValue)
at Infragistics.Controls.Charts.StraightNumericAxisBase.CalculateRange(NumericAxisBase target, Double minimumValue, Double maximumValue, Boolean isLogarithmic, Int32 logarithmBase, Double& actualMinimumValue, Double& actualMaximumValue)
at Infragistics.Controls.Charts.NumericAxisBase.UpdateRangeOverride()
at Infragistics.Controls.Charts.Axis.UpdateRange(Boolean immediate)
at Infragistics.Controls.Charts.ContentInfo.UndirtyRange()
at Infragistics.Controls.Charts.ContentInfo.DoRefresh()
at Infragistics.Controls.Charts.ChartContentManager.DoRefresh()
Thanks, Nikhil
The CalculateRange method perform a few calculations on userMinimum and userMaximum parameters to figure number of intervals for the numeric axis. This calculation might be throwing OverflowException if you are setting decimal values with higher precission then double values allow it. I suggest you try changing type of properties that you binding MinimumValue, MaximumValue and Interval of NumericYAxis to double type instead of decimal. If this issue still occurs please send me range of your data as well as values that you are setting on the MinimumValue, MaximumValue and Interval properties.
Hi Martin,
Could not share the data here. If you let me know which 2 decimal values are getting multiplied inside following method, I can try to see figure if any data issue..
Infragistics.Controls.Charts.AutoRangeCalculator.CalculateRange(NumericAxisBase target, Double userMinimum, Double userMaximum, Boolean isLogarithmic, Int32 logarithmBase, Double& minimumValue, Double& maximumValue)
I am binding MinimumValue, MaximumValue and Interval of NumericYAxis to properties in view model. Type of all 3 properties in my view model is Decimal.
Could that be any problem?
Hello Nikhil
Can you send me your sample code that generates this exception or range of your data points?
Thanks,
Martin