Note that when you set the ValueBinding
properties in Xaml they will expect strings with a valid property name. For example:
When you bind them like in the provided code snippet you are passing them the numbers contained in the Price and Count properties which are not valid property names.
However, the above code snippet won't work in your scenario. Instead of this you can create the value and category bindings in code-behind. The RadChartView
has two data-binding mechanisms: PropertyNameDataPointBinding and GenericDataPointBinding
. These two classes derive from the DataPointBinding
base class. In order to bind correctly the values from your Dictionary
you can use the GenericDataPointBinding
. Here is an example in code:
ValueSelector = (item) => item.Value.Count
ValueSelector = (item) => item.Value.Price
The KeyValuePair<string, DataItem>
is the record from your dictionary and double
is the type that should be passed to the series.
In addition I prepared a small project demonstrating this approach. Please give it a try and let me know if I am missing something.
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos
and start improving your app based on facts, not hunches.