This question is locked. New answers and comments are not allowed.
Hi,
I am using RadChart control for Silverlight.When i am creating Bar Series it is showing with the same color. I need to change each item with separate color. Please find My Xaml and C# code.
Please help me to resolve the issue.
Regards,
Kannan S
I am using RadChart control for Silverlight.When i am creating Bar Series it is showing with the same color. I need to change each item with separate color. Please find My Xaml and C# code.
Please help me to resolve the issue.
Regards,
Kannan S
<
telerik:RadChart
x:Name
=
"radChart"
telerik:StyleManager.Theme
=
"Windows7"
><
br
> <
telerik:RadChart.SeriesMappings
><
br
> <
telerik:SeriesMapping
><
br
> <
telerik:SeriesMapping.SeriesDefinition
><
br
> <
telerik:BarSeriesDefinition
/><
br
> </
telerik:SeriesMapping.SeriesDefinition
><
br
> <
telerik:SeriesMapping.ItemMappings
><
br
> <
telerik:ItemMapping
DataPointMember
=
"YValue"
FieldName
=
"Val"
/><
br
> <
telerik:ItemMapping
DataPointMember
=
"Label"
FieldName
=
"LabelString"
/><
br
> </
telerik:SeriesMapping.ItemMappings
><
br
> </
telerik:SeriesMapping
><
br
> </
telerik:RadChart.SeriesMappings
><
br
> </
telerik:RadChart
>
public
partial
class
MainPage : UserControl
{
public
MainPage()
{
InitializeComponent();
var list =
new
List<SomeInfo>();
Random r =
new
Random();
list.Add(
new
SomeInfo() { Val = 1, LabelString =
"Item 1"
});
list.Add(
new
SomeInfo() { Val = 2, LabelString =
"Item 2"
});
list.Add(
new
SomeInfo() { Val = r.Next(0, 10), LabelString =
"Item 3"
});
list.Add(
new
SomeInfo() { Val = r.Next(0, 10), LabelString =
"Item 4"
});
list.Add(
new
SomeInfo() { Val = r.Next(0, 10), LabelString =
"Item 5"
});
list.Add(
new
SomeInfo() { Val = r.Next(0, 10), LabelString =
"Item 6"
});
list.Add(
new
SomeInfo() { Val = r.Next(0, 10), LabelString =
"Item 7"
});
list.Add(
new
SomeInfo() { Val = r.Next(0, 10), LabelString =
"Item 8"
});
list.Add(
new
SomeInfo() { Val = r.Next(0, 10), LabelString =
"Item 9"
});
radChart.ItemsSource = list;
}
}
public
class
SomeInfo
{
public
int
Val {
get
;
set
; }
public
string
LabelString {
get
;
set
; }
}