I'm facing issue while binding RadCartesianChart, application is crashing. With the help of application log both x-axis and y-axis value are passing but still getting null reference exception.
Logged the stack. Please help
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.UI.Xaml.Controls.Chart.PresenterBase.CreateContentPresenter(Object content, DataTemplate template)
at Telerik.UI.Xaml.Controls.Chart.Axis.CreateLabelVisual(AxisLabelModel label)
at Telerik.UI.Xaml.Controls.Chart.Axis.GetLabelVisual(AxisLabelModel label, Int32 index)
at Telerik.UI.Xaml.Controls.Chart.Axis.MeasureLabel(AxisLabelModel label, Object content)
at Telerik.Charting.AxisModel.MeasureCo
----Stack----
at Telerik.UI.Xaml.Controls.Chart.PresenterBase.CreateContentPresenter(Object content, DataTemplate template)
at Telerik.UI.Xaml.Controls.Chart.Axis.CreateLabelVisual(AxisLabelModel label)
at Telerik.UI.Xaml.Controls.Chart.Axis.GetLabelVisual(AxisLabelModel label, Int32 index)
at Telerik.UI.Xaml.Controls.Chart.Axis.MeasureLabel(AxisLabelModel label, Object content)
at Telerik.Charting.AxisModel.MeasureCore(RadSize availableSize)
at Telerik.Charting.AxisModel.Measure(RadSize availableSize)
at Telerik.Charting.CartesianChartAreaModel.AxisStack.Measure(RadSize availableSize)
at Telerik.Charting.CartesianChartAreaModel.PrepareAxesStacks(RadSize availableSize)
at Telerik.Charting.CartesianChartAreaModel.ArrangeAxes(RadRect availableRect)
at Telerik.Charting.ChartAreaModelWithAxes.ArrangeOverride(RadRect rect)
at Telerik.Core.Node.Arrange(RadRect rect, Boolean shouldRoundLayout)
at Telerik.Core.RootElement.Arrange()
at Telerik.UI.Xaml.Controls.Chart.RadChartBase.CallUpdateUI()
at Telerik.UI.Xaml.Controls.Chart.RadChartBase.InvalidateLayout()
-------------
Thanks
I assume the question is related to the Telerik UI for UWP Chart control, not WPF Chart. As the namespace used is for our UWP controls. If this is so, I will update the thread title, as now it is RadCartesianChart binding issue in WPF
I will proceed with details about UI for UWP chart control.
I have followed the example provided here: https://docs.telerik.com/devtools/universal-windows-platform/controls/radchart/cartesianchart/series/categorical-series/categorical-barseries#example
and the chart is displayed as expected:
I am not sure what could be the issue on your side. Please send us the chart definition or a sample project, so we can research the case further. Note that in the forum only image attachments are allowed, if you want to send us a sample project, open a support ticket and attach the project to it.