To create dynamically RadChartView, I would suggest you take a look at the Create Data-Bound Chart
help article. The article describes the ValueBinding and CategoryBinding properties as well. These properties should be used only in data binding scenarios and should point to a property included in the view model. From the code you provided, I noticed that both properties are pointing to values and not to property names. This is why, when the additional series is added, the chart allocates the slot for this series, but is unable to find the property with its value and the point is left without value.
generation of the series of the chart, you can use the ChartSeriesProvider
. With this approach, you can directly work with a collection from your view model and leave the generation of the series to the provider.
The color of the series can be customized using the DefaultVisualStyle and DefaultVisualStyleSelector properties of the series. More information on how to work with them you can find in the Customizing CartesianChart Series
topic and the SDK example
showing their usage. You can also use a property from the view model to bind the color of the series items
On a side note, I would like to mention that I noticed some outdated code snippets in the last article I linked. They are making use of PointTemplate to modify the style of a point. Since the DefaultVisualStyle provides better performance of RadChartView, we are recommending to use it instead PointTemplate. More details on the concerns about that are available in this blog post
I hope this is helpful.
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin
, a suite of polished and feature-rich components for the Xamarin framework, which allow
you to write beautiful native mobile apps using a single shared C# codebase.