Hello,
I make a small project the demonstrate a possible issue: If i try to add more than one CustomGridLine with custom style is no longer working for the second, third,.... CustomGridLine added
Is there a posibility to have more than one CustomGridLine with custom style?
The xaml file:
<UserControl
x:Class="Telerik.Windows.Examples.Chart.Gallery.StackedSpline.Example"
xmlns:vm="clr-namespace:Telerik.Windows.Examples.Chart.Gallery.ViewModel"
xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
xmlns:chart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"
xmlns:charting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting">
<UserControl.DataContext>
<vm:UserDataViewModel ItemsCount="8" SeriesCount="2" />
</UserControl.DataContext>
<UserControl.Resources>
<Style x:Key="CustomGridLineStyle"
TargetType="Line">
<Setter Property="StrokeDashArray"
Value="1,1" />
</Style>
</UserControl.Resources>
<Border telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True">
<chart:RadChart x:Name="RadChart1" ItemsSource="{Binding CollectionData}">
<chart:RadChart.SeriesMappings>
<charting:SeriesMapping LegendLabel="Stacked Spline 1" CollectionIndex="0">
<charting:SeriesMapping.SeriesDefinition>
<charting:StackedSplineSeriesDefinition />
</charting:SeriesMapping.SeriesDefinition>
<charting:ItemMapping DataPointMember="YValue" />
</charting:SeriesMapping>
<charting:SeriesMapping LegendLabel="Stacked Spline 2" CollectionIndex="1">
<charting:SeriesMapping.SeriesDefinition>
<charting:StackedSplineSeriesDefinition />
</charting:SeriesMapping.SeriesDefinition>
<charting:ItemMapping DataPointMember="YValue" />
</charting:SeriesMapping>
</chart:RadChart.SeriesMappings>
<chart:RadChart.DefaultView>
<charting:ChartDefaultView>
<charting:ChartDefaultView.ChartArea>
<charting:ChartArea>
<charting:ChartArea.Annotations>
<charting:CustomGridLine YIntercept="3"
Stroke="Red"
StrokeThickness="2"
ElementStyle="{StaticResource CustomGridLineStyle}" />
<charting:CustomGridLine YIntercept="4"
Stroke="Red"
StrokeThickness="2"
ElementStyle="{StaticResource CustomGridLineStyle}" />
</charting:ChartArea.Annotations>
</charting:ChartArea>
</charting:ChartDefaultView.ChartArea>
<charting:ChartDefaultView.ChartLegend>
<charting:ChartLegend Name="legend" ReverseLegendItemsOrder="True" />
</charting:ChartDefaultView.ChartLegend>
</charting:ChartDefaultView>
</chart:RadChart.DefaultView>
</chart:RadChart>
</Border>
</UserControl>
The model:
using System.Collections.Generic;
The same behaviour if you use CustomLine instead of CustomGridLine!
Thank You!