Crash when putting a chart area in scrollviewer

3 posts, 0 answers
  1. Gilberto
    Gilberto avatar
    6 posts
    Member since:
    Apr 2009

    Posted 10 May 2009 Link to this post

    i have been running into a crash when i attempt to put the chart area into a scrollviewer.  I am trying to get it so that i can display all the information on the x Axis without it ending up all smashed togther.  Here is the code i am using  Also is there any option that allow you to control the spacing of the X axis so that the information is not smashed together if a lot of info is present? Or a scroll bar option already available?

    <UserControl x:Class="ChartTheme.Page" 
        <Grid x:Name="LayoutRoot" 
            <control:RadChart  x:Name="RadChart1" 
                        <RowDefinition Height="10" /> 
                        <RowDefinition Height="*" /> 
                        <ColumnDefinition Width="*" /> 
                        <ColumnDefinition Width="Auto" 
                                          MinWidth="104" /> 
                    <chart:ChartLegend x:Name="RadChartLegend" 
                                       Padding="-10, 20, 20, 30" 
                                       VerticalAlignment="Stretch" /> 
                    <ScrollViewer Grid.Row="1">  
                        <chart:ChartArea x:Name="RadChart2" 

    using System;  
    using System.Collections.Generic;  
    using System.Linq;  
    using System.Net;  
    using System.Windows;  
    using System.Windows.Controls;  
    using System.Windows.Documents;  
    using System.Windows.Input;  
    using System.Windows.Media;  
    using System.Windows.Media.Animation;  
    using System.Windows.Shapes;  
    using Telerik.Windows.Controls.Charting;  
    namespace ChartTheme  
        public partial class Page : UserControl  
            public Page()  
                Loaded += new RoutedEventHandler(Page_Loaded);  
            private void Page_Loaded(object sender, RoutedEventArgs e)  
                DataSeries barSeries = new DataSeries();  
                barSeries.Definition = new BarSeriesDefinition();  
                this.FillWithSampleData(barSeries, 100);  
                RadChart2.AxisY.AutoRange = true;  
            private void FillWithSampleData(DataSeries series, int numberOfItems)  
                Random random = new Random((int)(series.GetHashCode() + DateTime.Now.Ticks));  
                for(int i = 0; i < numberOfItems; i++)  
                    int randomNumber = random.Next(30, 100);  
                    series.Add(new DataPoint  
                        XValue = randomNumber,  
                        YValue = randomNumber  
  2. Velin
    Velin avatar
    391 posts

    Posted 13 May 2009 Link to this post

    Hi Gilberto,

    Unfortunately, I was able to reproduce the problem and I must confirm there is an unhandled exception when a chart element is contained within a control other than Panel or RadChart . This issue has been already forwarded to our developers and a fix will be provided with the next version of the control.

    Please, accept our apologies for the inconvenience. Your Telerik points have been updated.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Gilberto
    Gilberto avatar
    6 posts
    Member since:
    Apr 2009

    Posted 13 May 2009 Link to this post

    Thank you very much for the responce. I look forward to the next release.
Back to Top