Hello,
I think I want to use the Series Provider in xaml where I am defining my charts as I'm not entirely sure how many series there will be.
I do however want to use Generic DataPoint Bindings for the Value and Categories, and I don't see there being a way of doing that in xaml using the SeriesDescriptors. I feel like this isn't possible to do entirely of xaml since the Generic Data Point Bindings use lambda statements.. but maybe with a converter.. I just don't see it being a possibility with the SeriesDescriptor class.
Any thoughts?
Regards,
Colter
I think I want to use the Series Provider in xaml where I am defining my charts as I'm not entirely sure how many series there will be.
I do however want to use Generic DataPoint Bindings for the Value and Categories, and I don't see there being a way of doing that in xaml using the SeriesDescriptors. I feel like this isn't possible to do entirely of xaml since the Generic Data Point Bindings use lambda statements.. but maybe with a converter.. I just don't see it being a possibility with the SeriesDescriptor class.
Any thoughts?
Regards,
Colter
4 Answers, 1 is accepted
0
Hello Colter,
Tsvetie
Telerik
Straight to your questions:
- The number of the generated series depends on the number of collections in the itemssource. You can read more about the series provided here.
- Yes, you are correct. Because of the lambda expressions, you cannot define GenericDataPointBindings in XAML. You can read more about RadChartView support for GenericDataPointBindings in our online documentation:
Tsvetie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Louis
Top achievements
Rank 1
answered on 17 Sep 2013, 04:31 PM
Hi,
I'm trying to do the same thing of using GenericDataPointBindings against a SeriesProvider. While I understand how to do each of these individually, I have not been able to find the right way to combine the two, since CategoricalSeriesDescriptor does not support the ValueBinding property like a Series does (it only has ValuePath). How does one attach the GenericDataPointBinding to the variable number of axes generated by the SeriesProvider?
Thanks,
Louis
I'm trying to do the same thing of using GenericDataPointBindings against a SeriesProvider. While I understand how to do each of these individually, I have not been able to find the right way to combine the two, since CategoricalSeriesDescriptor does not support the ValueBinding property like a Series does (it only has ValuePath). How does one attach the GenericDataPointBinding to the variable number of axes generated by the SeriesProvider?
Thanks,
Louis
0
Hi Louis,
In order to set GenericDataPointBindings through XAML, you will need to define them as StaticResources. To do that you will need to make classes for each of the different bindings you want to have, that inherit from GenericDataPointBinding in order to make it non-generic and to set the ValueSelector in the constructor. Here's an example:
I hope this helps.
Regards,
Petar Kirov
Telerik
In order to set GenericDataPointBindings through XAML, you will need to define them as StaticResources. To do that you will need to make classes for each of the different bindings you want to have, that inherit from GenericDataPointBinding in order to make it non-generic and to set the ValueSelector in the constructor. Here's an example:
public
class
ChartPoint
{
public
string
XCat {
get
;
set
; }
public
double
Value {
get
;
set
; }
}
public
class
CategoryBinding : GenericDataPointBinding<ChartPoint,
string
>
{
public
CategoryBinding()
{
this
.ValueSelector = (cp) => cp.XCat;
}
}
public
class
ValueBinding : GenericDataPointBinding<ChartPoint,
double
>
{
public
ValueBinding()
{
this
.ValueSelector = (cp) => cp.Value;
}
}
<
UserControl.Resources
>
<
local:CategoryBinding
x:Key
=
"categoryBinding"
/>
<
local:ValueBinding
x:Key
=
"valueBinding"
/>
</
UserControl.Resources
>
<
telerik:RadCartesianChart
>
<
telerik:RadCartesianChart.SeriesProvider
>
<
telerik:ChartSeriesProvider
Source
=
"{Binding Series}"
>
<
telerik:ChartSeriesProvider.SeriesDescriptors
>
<
telerik:CategoricalSeriesDescriptor
ItemsSourcePath
=
"ChartPoints"
>
<
telerik:CategoricalSeriesDescriptor.Style
>
<
Style
TargetType
=
"telerik:BarSeries"
>
<
Setter
Property
=
"CategoryBinding"
Value
=
"{StaticResource categoryBinding}"
/>
<
Setter
Property
=
"ValueBinding"
Value
=
"{StaticResource valueBinding}"
/>
</
Style
>
I hope this helps.
Regards,
Petar Kirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Louis
Top achievements
Rank 1
answered on 19 Sep 2013, 04:18 PM
This approach worked great, thank you very much!
Louis
Louis