Using Axis AutoRange on Large Number

2 posts, 1 answers
  1. Alan
    Alan avatar
    3 posts
    Member since:
    May 2010

    Posted 23 Dec 2010 Link to this post

    I tried to set AutoRange on Y Axis to true and use a large number from 0 to 1E+29 and it crashed when the chart is recalculating the min/max and step.
    If I set AutoRange to false and set my own min/max/step value, I won't be able to see the axis value. Is there any suggestion to work around on this issue?
    Here is the exception message:
    System.OverflowException was unhandled by user code
      Message=Value was either too large or too small for a Decimal.
      StackTrace:
           at System.Decimal..ctor(Double value)
           at System.Decimal.op_Explicit(Double value)
           at Telerik.Windows.Controls.Charting.MathExtensions.Round(Double number, Double precision)
           at Telerik.Windows.Controls.Charting.AxisRange.RoundMinValue(Double minValue, Double range)
           at Telerik.Windows.Controls.Charting.AxisRange.CalculateMinValue()
           at Telerik.Windows.Controls.Charting.AxisRange.UpdateRange()
           at Telerik.Windows.Controls.Charting.AxisRangeY.UpdateRange()
           at Telerik.Windows.Controls.Charting.AxisRange.set_SeriesMaxValue(Double value)
           at Telerik.Windows.Controls.Charting.AxisY.AdjustRangeValuesForZoomScroll(Double calculatedMinValue, Double calculatedMaxValue)
           at Telerik.Windows.Controls.Charting.AxisY.InitializeAxisValuesForAutoRange()
           at Telerik.Windows.Controls.Charting.Axis.BuildAxisData()
           at Telerik.Windows.Controls.Charting.AxisY.BuildAxisData()
           at Telerik.Windows.Controls.Charting.Axis.UpdateAxis()
           at Telerik.Windows.Controls.Charting.AxisY.UpdateAxis()
           at Telerik.Windows.Controls.Charting.Axis.ChartAreaDataChanged(Object sender, EventArgs e)
           at System.EventHandler.Invoke(Object sender, EventArgs e)
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataChanged()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at System.Collections.ObjectModel.ObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Data.RadObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.DataSeries.set_ZPosition(Int32 value)
           at Telerik.Windows.Controls.Charting.ZAggregator.UpdateLayers(Int32 seriesIndex, DataSeries series)
           at Telerik.Windows.Controls.Charting.ZAggregator.ReevaluateLayers()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at System.Collections.ObjectModel.ObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Data.RadObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.DataSeries.set_ZPosition(Int32 value)
           at Telerik.Windows.Controls.Charting.ZAggregator.UpdateLayers(Int32 seriesIndex, DataSeries series)
           at Telerik.Windows.Controls.Charting.ZAggregator.ReevaluateLayers()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at System.Collections.ObjectModel.ObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Data.RadObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.DataSeries.set_ZPosition(Int32 value)
           at Telerik.Windows.Controls.Charting.ZAggregator.UpdateLayers(Int32 seriesIndex, DataSeries series)
           at Telerik.Windows.Controls.Charting.ZAggregator.ReevaluateLayers()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at System.Collections.ObjectModel.ObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Data.RadObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.DataSeries.set_ZPosition(Int32 value)
           at Telerik.Windows.Controls.Charting.ZAggregator.UpdateLayers(Int32 seriesIndex, DataSeries series)
           at Telerik.Windows.Controls.Charting.ZAggregator.ReevaluateLayers()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at System.Collections.ObjectModel.ObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Data.RadObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.DataSeries.set_ZPosition(Int32 value)
           at Telerik.Windows.Controls.Charting.ZAggregator.UpdateLayers(Int32 seriesIndex, DataSeries series)
           at Telerik.Windows.Controls.Charting.ZAggregator.ReevaluateLayers()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at System.Collections.ObjectModel.ObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Data.RadObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.DataSeries.set_ZPosition(Int32 value)
           at Telerik.Windows.Controls.Charting.ZAggregator.UpdateLayers(Int32 seriesIndex, DataSeries series)
           at Telerik.Windows.Controls.Charting.ZAggregator.ReevaluateLayers()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at System.Collections.ObjectModel.ObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Data.RadObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.DataSeries.set_ZPosition(Int32 value)
           at Telerik.Windows.Controls.Charting.ZAggregator.UpdateLayers(Int32 seriesIndex, DataSeries series)
           at Telerik.Windows.Controls.Charting.ZAggregator.ReevaluateLayers()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at System.Collections.ObjectModel.ObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Data.RadObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.DataSeries.set_ZPosition(Int32 value)
           at Telerik.Windows.Controls.Charting.ZAggregator.UpdateLayers(Int32 seriesIndex, DataSeries series)
           at Telerik.Windows.Controls.Charting.ZAggregator.ReevaluateLayers()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at System.Collections.ObjectModel.ObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Data.RadObservableCollection`1.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.DataSeries.set_ZPosition(Int32 value)
           at Telerik.Windows.Controls.Charting.ZAggregator.UpdateLayers(Int32 seriesIndex, DataSeries series)
           at Telerik.Windows.Controls.Charting.ZAggregator.ReevaluateLayers()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
           at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
           at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
           at Telerik.Windows.Data.RadObservableCollection`1.ResumeNotifications()
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.AddRange(IEnumerable`1 items)
           at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ChartArea chartArea)
           at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData)
           at Telerik.Windows.Controls.RadChart.Rebind(Object originalData)
           at Telerik.Windows.Controls.RadChart.ItemsSourcePropertyChanged(DependencyObject target, DependencyPropertyChangedEventArgs args)
           at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e)
           at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
           at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
           at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
           at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
           at Telerik.Windows.Controls.RadChart.set_ItemsSource(Object value)
  2. Answer
    Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 27 Dec 2010 Link to this post

    Hi Alan,

    Indeed, the behavior which you described may be observed. The control will handle data up to decimal.MaxValue. You can try to lower the order of data before sending it to RadChart.
    I hope this suggestion helps.

    All the best,
    Yavor
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
Back to Top