Hi,
Based on the XCategory we can chnage the colors boss so now you can chnage the colors based on the week name i think.
It will work out for you please check and let me know any issues.
private Style CreateItemStyle(Control control, Style baseStyle, DataPoint dataPoint, DataSeries dataSeries)
{
// Do not change the style of the legend item
if (control is ChartLegendItem)
return baseStyle;
if (dataPoint == null)
return baseStyle;
// Create a new style, do not use the one that is provided as parameter.
Style newStyle = new Style(baseStyle.TargetType);
newStyle.BasedOn = baseStyle;
Brush brush = null;
foreach (List list1 in _Minlist)
{
if (dataPoint.XCategory == list1 .Name)
{
if (list1 .CategoryUniqueName.Contains("USA"))
{
brush = new SolidColorBrush(Colors.Orange);
}
else if (list1 .CategoryUniqueName.Contains("MapState"))
{
brush = new SolidColorBrush(Colors.Green);
}
else if (list1 .CategoryUniqueName.Contains("Practice"))
{
brush = new SolidColorBrush(Colors.Blue);
}
else if (list1 .CategoryUniqueName.Contains("Physician"))
{
brush = new SolidColorBrush(Colors.Yellow);
}
}
}
if (control is BaseChartItem2D)
newStyle.Setters.Add(new Setter(Shape.FillProperty, brush));
return newStyle;
}
Like the above
so please find the Xcatogory with the help of datapoint and you apply the same logic......
if (datapoint.Xcatogory == "Monday")
{
brush = new SolidColorBrush(Colors.Orange);
}
else if (datapoint.Xcatogory == "Friday")
{
brush = new SolidColorBrush(Colors.Red);
}
else
{
brush = new SolidColorBrush(Colors.Orange);
}
.
.
.
.
.
..
etc
Thanks
Vijay
Kommalapati