Javascript error with CategoricalSeriesDescriptor

1 posts, 0 answers
  1. kity
    kity avatar
    71 posts
    Member since:
    Mar 2012

    Posted 14 Jan 2015 Link to this post



    // CONTROL CHART <UserControl x:Class="Testing.Controls.ControlChartView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        mc:Ignorable="d"
        d:DesignHeight="300" d:DesignWidth="400">
       
        <Grid x:Name="LayoutRoot" Background="White">
            <telerik:RadCartesianChart >
                <telerik:RadCartesianChart.HorizontalAxis>
                    <telerik:DateTimeContinuousAxis MajorStepUnit="Year" MajorStep="10" LineStroke="#AEAEAE" LabelFormat="yyyy"
                                                    LabelFitMode="MultiLine"
                                                    Minimum="{Binding Path=DataContext.Filter.PickerSelectionStart, Mode=OneWay, RelativeSource={RelativeSource AncestorType=UserControl}}"
                                                    Maximum="{Binding Path=DataContext.Filter.PickerSelectionEnd, Mode=OneWay, RelativeSource={RelativeSource AncestorType=UserControl}}" />
                </telerik:RadCartesianChart.HorizontalAxis>            <telerik:RadCartesianChart.VerticalAxis>
                    <telerik:LinearAxis LineStroke="#AEAEAE" />
                </telerik:RadCartesianChart.VerticalAxis>            <telerik:RadCartesianChart.SeriesProvider>
                    <telerik:ChartSeriesProvider Source="{Binding AxisCollection}">
                        <telerik:ChartSeriesProvider.SeriesDescriptors>
                           
                            <telerik:CategoricalSeriesDescriptor ItemsSourcePath="ItemsSource" CategoryPath="Date" ValuePath="Value">
                                <telerik:CategoricalSeriesDescriptor.Style>
                                    <Style TargetType="telerik:SplineSeries" />
                                </telerik:CategoricalSeriesDescriptor.Style>
                            </telerik:CategoricalSeriesDescriptor>
                           
                           
                        </telerik:ChartSeriesProvider.SeriesDescriptors>
                    </telerik:ChartSeriesProvider>
                </telerik:RadCartesianChart.SeriesProvider>            <telerik:RadCartesianChart.Grid>
                    <telerik:CartesianChartGrid />
                </telerik:RadCartesianChart.Grid>
               
            </telerik:RadCartesianChart>       
        </Grid>
    </UserControl>
    // Call control chart in ItemsControl <ItemsControl ItemsSource="{Binding ChartCollection, Mode=TwoWay}" VerticalAlignment="Stretch" >
                  
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <controls1:ControlChartView />                       
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
               
               
               
    Random javascript error at runtime
    "Unhandled Error in Silverlight Application \nCode: 4004    \nCategory: ManagedRuntimeError      
    \nMessage: System.NullReferenceException: Object reference not set to an instance of an object.\r\n  
    at Telerik.Windows.Controls.ChartView.ChartSeriesDescriptor.CreateDefaultInstance(Object context)\r\n 
     at Telerik.Windows.Controls.ChartView.ChartSeriesDescriptor.CreateInstanceCore(Object context)\r\n  
     at Telerik.Windows.Controls.ChartView.CategoricalSeriesDescriptor.CreateInstanceCore(Object context)\r\n  
     at Telerik.Windows.Controls.ChartView.ChartSeriesDescriptor.CreateInstance(Object context)\r\n  
     at Telerik.Windows.Controls.ChartView.ChartSeriesProvider.CreateSeries(Object context, ChartSeriesDescriptor descriptor)\r\n  
     at Telerik.Windows.Controls.ChartView.ChartSeriesProvider.<CreateSeries>d__4.MoveNext()\r\n  
     at Telerik.Windows.Controls.ChartView.RadChartBase.AddDynamicSeries()\r\n  
     at Telerik.Windows.Controls.ChartView.RadChartBase.OnApplyTemplate()\r\n 
      at System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)     \n"
Back to Top