RadCartesianChart '-1' is not a valid value for property 'Height'.

4 posts, 0 answers
  1. LOUGE
    LOUGE avatar
    12 posts
    Member since:
    Jun 2010

    Posted 28 Oct 2013 Link to this post

    Hi,

    I'm facing a serious problem using RadCartesianChart.



    Sometimes i receive this exception :

    '-1' is not a valid value for property 'Height'.   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at System.Windows.FrameworkElement.set_Height(Double value)
       at Telerik.Windows.Controls.ChartView.PresenterBase.ArrangeUIElement(FrameworkElement presenter, RadRect layoutSlot, Boolean setSize)
       at Telerik.Windows.Controls.ChartView.PointTemplateSeries.UpdatePresenters(ChartLayoutContext context)
       at Telerik.Windows.Controls.ChartView.PointTemplateSeries.UpdateUICore(ChartLayoutContext context)
       at Telerik.Windows.Controls.ChartView.PresenterBase.UpdateUI(ChartLayoutContext context)
       at Telerik.Windows.Controls.ChartView.RadChartBase.UpdateUICore(ChartLayoutContext context)
       at Telerik.Windows.Controls.ChartView.PresenterBase.UpdateUI(ChartLayoutContext context)
       at Telerik.Windows.Controls.ChartView.RadChartBase.CallUpdateUI()
       at Telerik.Windows.Controls.ChartView.RadChartBase.OnInvalidated()
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)




    After this exception the control stops working. Have you an idea ?



    Thanks a lot by advance







  2. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 28 Oct 2013 Link to this post

    Hi Louge,

    Given only the provided information (stack trace) we are not able to determine the cause of the problem. In order to help you we will need to reproduce the problem on our side, so we can investigate it. It would be best if you could provide a small runable project.

    Thanks for the understanding.

    Regards,
    Petar Kirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. LOUGE
    LOUGE avatar
    12 posts
    Member since:
    Jun 2010

    Posted 29 Oct 2013 Link to this post

    Sorry this is a sample code :


    XAML



    <telerik:RadCartesianChart>
                <telerik:RadCartesianChart.HorizontalAxis>
                    <telerik:CategoricalAxis  />
                </telerik:RadCartesianChart.HorizontalAxis>
                <telerik:RadCartesianChart.VerticalAxis>
                    <telerik:LinearAxis Maximum="{Binding MaxValue}"
                                        Minimum="{Binding MinValue}"/>
                </telerik:RadCartesianChart.VerticalAxis>
                <telerik:RangeBarSeries ItemsSource="{Binding Items}"
                                        CategoryBinding="XValue"
                                        HighBinding="Max"
                                        LowBinding="Min" />
            </telerik:RadCartesianChart>




    CS



    using System;
    using System.Collections.Generic;
    using System.Windows;
     
    namespace WpfApplication1
    {
        /// <summary>
        /// Interaction logic for MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window
        {
            public MainWindow()
            {
                InitializeComponent();
     
     
                ExtremaDatas datas = new ExtremaDatas()
                    {
                        MinValue = 0.0,
                        MaxValue = 1000.0,
                        Items = new List<ExtremaDataItem>()
                            {
                                new ExtremaDataItem()
                                    {
                                        Min = 0.0,
                                        Max = 0.0,
                                        XValue = "0"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 0.0,
                                        Max = 0.0,
                                        XValue = "1"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 0.0,
                                        Max = 0.0,
                                        XValue = "2"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 0.0,
                                        Max = 0.0,
                                        XValue = "3"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 0.0,
                                        Max = 0.0,
                                        XValue = "4"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 0.0,
                                        Max = 0.0,
                                        XValue = "5"
                                    },
     
                                new ExtremaDataItem()
                                    {
                                        Min = 0.0,
                                        Max = 2.0,
                                        XValue = "6"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 4.0,
                                        Max = 14.0,
                                        XValue = "7"
                                    },
     
                                new ExtremaDataItem()
                                    {
                                        Min = 11.0,
                                        Max = 79.0,
                                        XValue = "8"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 59.0,
                                        Max = 81.0,
                                        XValue = "9"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 64.0,
                                        Max = 563.1,
                                        XValue = "10"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 93.0,
                                        Max = 596.2,
                                        XValue = "11"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 66.0,
                                        Max = 93.0,
                                        XValue = "12"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 66.0,
                                        Max = 90.0,
                                        XValue = "13"
                                    },
     
     
                                new ExtremaDataItem()
                                    {
                                        Min = 73.0,
                                        Max = 956.2,
                                        XValue = "14"
                                    },
     
                                new ExtremaDataItem()
                                    {
                                        Min = 67.0,
                                        Max = 953.0,
                                        XValue = "15"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 62.0,
                                        Max = 972.2,
                                        XValue = "16"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 47.0,
                                        Max = 954.9,
                                        XValue = "17"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 1.0,
                                        Max = 935.0,
                                        XValue = "18"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 0.0,
                                        Max = 1.0,
                                        XValue = "19"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 0.0,
                                        Max = 1.0,
                                        XValue = "20"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 0.0,
                                        Max = 1.0,
                                        XValue = "21"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 0.0,
                                        Max = 1.0,
                                        XValue = "22"
                                    },
                                new ExtremaDataItem()
                                    {
                                        Min = 0.0,
                                        Max = 0.0,
                                        XValue = "23"
                                    }
                            }
                    };
     
     
                DataContext = datas;
            }
        }
     
        public class ExtremaDatas
        {
            public Double MaxValue
            {
                get;
                set;
            }
     
            public Double MinValue
            {
                get;
                set;
            }
     
            public List<ExtremaDataItem> Items
            {
                get;
                set;
            }
        }
     
          public class ExtremaDataItem
        {
          
            public ExtremaDataItem()
            {
     
            }
     
            public String XValue
            {
                get;
                set;
            }
     
            public Double Min
            {
                get;
                set;
            }
     
            public Double Max
            {
                get;
                set;
            }
     
            /// <summary>
            /// Returns a <see cref="System.String"/> that represents this instance.
            /// </summary>
            /// <returns>
            /// A <see cref="System.String"/> that represents this instance.
            /// </returns>
            public override String ToString()
            {
                return String.Format("Min={0} - Max={1}", Min, Max);
            }
     
        }
    }






























  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 31 Oct 2013 Link to this post

    Hello,

    Thank you for the attached code snippets. I was able to create a new project based on this code and reproduce the exception. This is unfortunately a bug in the ChartView control where an invalid height is being calculated when the difference between the High and Low of the RangeDataPoint is small in accordance to the axis' range. I have logged this as a bug in our PITS where you can vote and track its status. I have updated your Telerik points as a sign of gratitude for taking out of your time and helping us improve our products!

    Unfortunately I cannot suggest a work-around and I hope that you will be able to wait for the next SP when this bug will be fixed.

    Regards,
    Petar Marchev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top