Hi,
I want to display dynamic data with a dynamic count of series.
There is already a, in my opinion, very straight forward solution for this in a RadChart (only difference is that I'm doing it with a StackedBarSeries, but it works as well).
[quote]Luis said:Hello,
I have a data structure like this:
Year - Team - Value
2010 - T1 - 50
2010 - T2 - 70
2009 - T1 - 40
2009 - T2 - 45
...
Years and teams can growing dinamically. I need a Bar Chart where:
- One data serie for each team
- Years in the axis X
- One bar for each serie in each year with the value as height
I've seen the "Data Binding with Automatic Series Mappings" sample, but it's not what i need.
Please, help me.
Thanks a lot.
[/quote]
Is it possible to do the same thing like in the link with a RadCartesianChart? Or should I stick with the RadChart?
I want to display dynamic data with a dynamic count of series.
There is already a, in my opinion, very straight forward solution for this in a RadChart (only difference is that I'm doing it with a StackedBarSeries, but it works as well).
[quote]Luis said:Hello,
I have a data structure like this:
Year - Team - Value
2010 - T1 - 50
2010 - T2 - 70
2009 - T1 - 40
2009 - T2 - 45
...
Years and teams can growing dinamically. I need a Bar Chart where:
- One data serie for each team
- Years in the axis X
- One bar for each serie in each year with the value as height
I've seen the "Data Binding with Automatic Series Mappings" sample, but it's not what i need.
Please, help me.
Thanks a lot.
[/quote]
<
telerik:RadChart
x:Name
=
"RadChart1"
>
<
telerik:RadChart.SeriesMappings
>
<
telerik:SeriesMapping
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:StackedBarSeriesDefinition
/>
</
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:SeriesMapping.GroupingSettings
>
<
telerik:GroupingSettings
ShouldCreateSeriesForLastGroup
=
"True"
>
<
telerik:GroupingSettings.GroupDescriptors
>
<
telerik:ChartGroupDescriptor
Member
=
"Team"
/>
</
telerik:GroupingSettings.GroupDescriptors
>
</
telerik:GroupingSettings
>
</
telerik:SeriesMapping.GroupingSettings
>
<
telerik:SeriesMapping.ItemMappings
>
<
telerik:ItemMapping
FieldName
=
"Value"
DataPointMember
=
"YValue"
/>
<
telerik:ItemMapping
FieldName
=
"Year"
DataPointMember
=
"XCategory"
/>
</
telerik:SeriesMapping.ItemMappings
>
</
telerik:SeriesMapping
>
</
telerik:RadChart.SeriesMappings
>
</
telerik:RadChart
>
public
partial
class
Example2 : UserControl
{
public
Example2()
{
InitializeComponent();
List<Record> data =
new
List<Record>()
{
new
Record(2009,
"First team"
, 25),
new
Record(2010,
"First team"
, 35),
new
Record(2011,
"First team"
, 45),
new
Record(2009,
"Second team"
, 15),
new
Record(2010,
"Second team"
, 25),
new
Record(2011,
"Second team"
, 75),
new
Record(2009,
"Third team"
, 67),
new
Record(2010,
"Third team"
, 20),
new
Record(2011,
"Third team"
, 88),
new
Record(2009,
"Fourth team"
, 34),
new
Record(2010,
"Fourth team"
, 67),
new
Record(2011,
"Fourth team"
, 91),
new
Record(2009,
"Fifth team"
, 87),
new
Record(2010,
"Fifth team"
, 77),
new
Record(2011,
"Fifth team"
, 12)
};
this
.RadChart1.ItemsSource = data;
}
}
public
class
Record
{
public
Record(
int
year,
string
team,
int
value)
{
Year = year;
Team = team;
Value = value;
}
public
int
Value {
get
;
set
; }
public
string
Team {
get
;
set
; }
public
int
Year {
get
;
set
; }
}
Is it possible to do the same thing like in the link with a RadCartesianChart? Or should I stick with the RadChart?