This question is locked. New answers and comments are not allowed.
Greetings,
We recently purchased the new version of telerik Developer Components. Until now, we had the q3 2010 version. All was working well in our charting project.
After the upgrade (uninstalled the previous version, removed the past references and added the new ones), the chart is not working any longer. We had two radchart controls on a page. The first one received the collection, made, grouped the data into series.
After this is created, we used the dataseries created in this one and created another radchart with default layout false, to put each series on a different chartarea(with different axes). We receive an error on the function that creates this second chart based on the data from the first one. The error does not appear with the debugger,the silverlight application goes all blank and ie reports in the left lower corner "Error on page":
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Timestamp: Thu, 31 Mar 2011 16:25:06 UTC
Message: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.Windows.Markup.XamlParseException: [Line: 0 Position: 0] ---> System.NullReferenceException: Object reference not set to an instance of an object.
la Telerik.Windows.Controls.Charting.DataPoint.GetNextSignificantIndex()
la Telerik.Windows.Controls.Charting.DataPoint.GetNextSignificantDataPoint()
la Telerik.Windows.Controls.Charting.SimpleShiftXAggregator.CalculateItemWidth(DataSeries dataSeries, Int32 index, DataRange range)
la Telerik.Windows.Controls.Charting.SimpleShiftXAggregator.CalculateRange(DataSeries dataSeries, Int32 index, DataRange range)
la Telerik.Windows.Controls.Charting.AxisX.CalculateItemRange(DataSeries dataSeries, Int32 index)
la Telerik.Windows.Controls.Charting.SelfDrawingSeries.EvaluateXRangeAtIndex(Int32 index)
la Telerik.Windows.Controls.Charting.SelfDrawingSeries.CalculateLinePoints(Func`2 extractXRangeValue, Func`3 extractYRangeValue)
la Telerik.Windows.Controls.Charting.LineSeries.CalculatePoints(Func`2 extractXRangeValue, Func`3 extractYRangeValue)
la Telerik.Windows.Controls.Charting.SelfDrawingSeries.CreateFigures()
la Telerik.Windows.Controls.Charting.SelfDrawingSeries.InitializeTopBorderLineGeometry()
la Telerik.Windows.Controls.Charting.SelfDrawingSeries.InitializeSeriesGeometry()
la Telerik.Windows.Controls.Charting.SelfDrawingSeries.OnApplyTemplate()
la System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)
--- Final urmărire stivă internă de excepţii ---
la MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
la MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
la MS.Internal.XcpImports.FrameworkElement_ApplyTemplate(FrameworkElement frameworkElement)
la System.Windows.Controls.ItemContainerGenerator.LayoutStatesManager.GetElementRoot(Boolean templatesAreGenerated)
la System.Windows.Controls.ItemContainerGenerator.LayoutStatesManager.Load()
la System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
la System.Windows.Controls.ItemsControl.AddVisualChild(Int32 containerIndex, DependencyObject container, Boolean needPrepareContainer)
la System.Windows.Controls.ItemsControl.AddContainers()
la System.Windows.Controls.ItemsControl.RecreateVisualChildren(IntPtr unmanagedObj)
Line: 57
Char: 13
Code: 0
URI: http://localhost/TestRiaRadLinq.Web/Romanian.aspx
Our function is:
I have no ideea how to debug this, because the error does not appear to be in our code.
Do you have any ideea why this is happening?
Thank you,
Dan
We recently purchased the new version of telerik Developer Components. Until now, we had the q3 2010 version. All was working well in our charting project.
After the upgrade (uninstalled the previous version, removed the past references and added the new ones), the chart is not working any longer. We had two radchart controls on a page. The first one received the collection, made, grouped the data into series.
After this is created, we used the dataseries created in this one and created another radchart with default layout false, to put each series on a different chartarea(with different axes). We receive an error on the function that creates this second chart based on the data from the first one. The error does not appear with the debugger,the silverlight application goes all blank and ie reports in the left lower corner "Error on page":
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Timestamp: Thu, 31 Mar 2011 16:25:06 UTC
Message: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.Windows.Markup.XamlParseException: [Line: 0 Position: 0] ---> System.NullReferenceException: Object reference not set to an instance of an object.
la Telerik.Windows.Controls.Charting.DataPoint.GetNextSignificantIndex()
la Telerik.Windows.Controls.Charting.DataPoint.GetNextSignificantDataPoint()
la Telerik.Windows.Controls.Charting.SimpleShiftXAggregator.CalculateItemWidth(DataSeries dataSeries, Int32 index, DataRange range)
la Telerik.Windows.Controls.Charting.SimpleShiftXAggregator.CalculateRange(DataSeries dataSeries, Int32 index, DataRange range)
la Telerik.Windows.Controls.Charting.AxisX.CalculateItemRange(DataSeries dataSeries, Int32 index)
la Telerik.Windows.Controls.Charting.SelfDrawingSeries.EvaluateXRangeAtIndex(Int32 index)
la Telerik.Windows.Controls.Charting.SelfDrawingSeries.CalculateLinePoints(Func`2 extractXRangeValue, Func`3 extractYRangeValue)
la Telerik.Windows.Controls.Charting.LineSeries.CalculatePoints(Func`2 extractXRangeValue, Func`3 extractYRangeValue)
la Telerik.Windows.Controls.Charting.SelfDrawingSeries.CreateFigures()
la Telerik.Windows.Controls.Charting.SelfDrawingSeries.InitializeTopBorderLineGeometry()
la Telerik.Windows.Controls.Charting.SelfDrawingSeries.InitializeSeriesGeometry()
la Telerik.Windows.Controls.Charting.SelfDrawingSeries.OnApplyTemplate()
la System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)
--- Final urmărire stivă internă de excepţii ---
la MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
la MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
la MS.Internal.XcpImports.FrameworkElement_ApplyTemplate(FrameworkElement frameworkElement)
la System.Windows.Controls.ItemContainerGenerator.LayoutStatesManager.GetElementRoot(Boolean templatesAreGenerated)
la System.Windows.Controls.ItemContainerGenerator.LayoutStatesManager.Load()
la System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
la System.Windows.Controls.ItemsControl.AddVisualChild(Int32 containerIndex, DependencyObject container, Boolean needPrepareContainer)
la System.Windows.Controls.ItemsControl.AddContainers()
la System.Windows.Controls.ItemsControl.RecreateVisualChildren(IntPtr unmanagedObj)
Line: 57
Char: 13
Code: 0
URI: http://localhost/TestRiaRadLinq.Web/Romanian.aspx
Our function is:
public void createRadChart(DataSeriesCollection dS, SeriesMapping sMap, ChartLegend colectieItems, List<wcfService.Signal> listaLegenda) { // sMap.ChartAreaName = "Chart1"; radChart2.UseDefaultLayout = false; // radChart2.SeriesMappings.Add(sMap); Grid chartLayout = new Grid(); chartLayout.Margin = new Thickness(10, 10, 0, 20); chartLayout.RowDefinitions.Add(new RowDefinition()); chartLayout.RowDefinitions[0].Height = new GridLength(60); radChart2.SamplingSettings.SamplingThreshold = 1000; radChart2.SamplingSettings.SamplingFunction = ChartSamplingFunction.KeepExtremes; //Creating ChartTitle for the left chart Telerik.Windows.Controls.Charting.ChartTitle chartTitle = new Telerik.Windows.Controls.Charting.ChartTitle(); chartTitle.Margin = new Thickness(0, 0, 0, 10); chartTitle.HorizontalAlignment = HorizontalAlignment.Stretch; chartTitle.Content = ApplicationStrings.Vibrations_GeneratorPageTitle+Environment.NewLine + startDate.SelectedDate.Value.Day+"/"+ startDate.SelectedDate.Value.Month+"/"+ startDate.SelectedDate.Value.Year+" <--> "+endDate.SelectedDate.Value.Day+"/"+ endDate.SelectedDate.Value.Month+"/"+ endDate.SelectedDate.Value.Year; chartLayout.Children.Add(chartTitle); Grid.SetRow(chartTitle, 0); for (int i=0; i<dS.Count;i++) { chartLayout.RowDefinitions.Add(new RowDefinition()); // chartLayout.RowDefinitions.Add(new RowDefinition()); } chartLayout.RowDefinitions.Add(new RowDefinition()); chartLayout.RowDefinitions[dS.Count+1].Height = new GridLength(150); Telerik.Windows.Controls.Charting.ChartLegend ChartLegend = new Telerik.Windows.Controls.Charting.ChartLegend(); ChartLegend.HorizontalAlignment = HorizontalAlignment.Stretch; ChartLegend.VerticalAlignment = VerticalAlignment.Stretch; ChartLegend.UseAutoGeneratedItems = false; ChartLegend.Name = "LegendaComuna"; radChart2.Content = chartLayout; Grid.SetRow(ChartLegend, dS.Count+1); List<ChartItemsLegend> lista = new List<ChartItemsLegend>(); for (int i = 0; i < dS.Count; i++) { Telerik.Windows.Controls.Charting.ChartArea chartArea1 = new Telerik.Windows.Controls.Charting.ChartArea(); chartArea1.Name = "Chart" + i; chartArea1.AxisY.AutoRange = false; if (i == 5) { chartArea1.AxisY.AddRange(Convert.ToDouble(listaLegenda[i].Disp_Min), Convert.ToDouble(listaLegenda[i].Disp_Max), Convert.ToDouble(listaLegenda[i].Disp_Max) / 5); } else { chartArea1.AxisY.AddRange(Convert.ToDouble(listaLegenda[i].Disp_Min), Convert.ToDouble(listaLegenda[i].Disp_Max), Convert.ToDouble(listaLegenda[i].Disp_Max) / 5); } chartArea1.AxisX.DefaultLabelFormat = "MMM-dd"; chartArea1.EnableAnimations = false; chartArea1.EnableTransitionAnimations = false; chartArea1.LabelFormatBehavior = LabelFormatBehavior.None; chartArea1.AxisY.Title = listaLegenda[i].Disp_Unit; chartArea1.AxisX.AutoRange = false; chartArea1.AxisX.MinValue = new DateTime(Convert.ToDateTime(sDate).Ticks).ToOADate(); chartArea1.AxisX.MaxValue = new DateTime(Convert.ToDateTime(eDate).Ticks).ToOADate(); chartArea1.AxisX.Step = 5; chartArea1.AxisY.MajorGridLinesVisibility = Visibility.Visible; chartArea1.AxisX.MajorGridLinesVisibility = Visibility.Visible; if (i == dS.Count-1) { chartArea1.AxisX.Visibility = Visibility.Visible; } else { chartArea1.AxisX.Visibility = Visibility.Collapsed; } chartArea1.LegendName = "LegendaComuna"; Color culoare = GetRandomColor(); Brush brush = new SolidColorBrush(Culori[i]); chartArea1.PaletteBrushes.Add(brush) ; ChartLegendItem item1 = new ChartLegendItem(); item1.Label = listaLegenda[i].Signal_Name + " - " + listaLegenda[i].Description; item1.MarkerFill = new SolidColorBrush(Culori[i]); ChartLegend.Items.Add(item1); chartArea1.DataSeries.Add(dS[i]); chartLayout.Children.Add(chartArea1); Grid.SetRow(chartArea1, i+1); } chartLayout.Children.Add(ChartLegend); busyIndicator.IsBusy = false; }I have no ideea how to debug this, because the error does not appear to be in our code.
Do you have any ideea why this is happening?
Thank you,
Dan