I currently have a line chart with multiple series by using SeriesMappings in the code-behind. I have bound a method to ItemToolTipOpening so that I can change the opacity of all other lines except the one displaying the tooltip. The opacity changes correctly, but the opacity of the legend items stay the same. What is the best way to change the item colors?
When I check RadChart1.DefaultView.ChartLegend.Items or RadChart1.DefaultView.ChartArea.Legend.Items, nothing exists for either (both have 0 items). What is the relation between SeriesMappings and ChartLegend's Items?
Here is the method that changes the colors/opacity:
private void onSeries(ItemToolTip2D tooltip, ItemToolTipEventArgs e) |
{ |
foreach (DataSeries series in radChart1.DefaultView.ChartArea.DataSeries) |
{ |
if (!series.Equals(e.DataSeries)) |
{ |
Color color = ((SolidColorBrush)series.Definition.Appearance.Fill).Color; |
color.A = 10; |
series.Definition.Appearance.Stroke = |
series.Definition.Appearance.Fill = new SolidColorBrush(color); |
} |
} |
} |
Thank you,
Sean