I'm adding two dynamic series to a chart, one LineSeries and one PointSeries
For the LineSeries i leave all the styling as default, and I tried using the standards Palettes (Windows8 in this case). When I have more than one series, everything's ok. However, when I only have 1 series shown on the grid, then the LineSeries somehow skips the first color and shows the second one.
I tried reproducing the problem using a custom palette just to see if I was doing something wrong, but the behavior is the same (first color skipped when only 1 series). What's going on?
chart definition:
<telerik:RadCartesianChart Grid.Row="0" Height="Auto" Name="ChartControl" BorderThickness="0" Background="Transparent" Palette="Windows8" DataContextChanged="OnChartSeriesUpdated"> <telerik:RadCartesianChart.Annotations> <telerik:CartesianGridLineAnnotation ZIndex="-200" Value= "7" Stroke="Black" StrokeThickness="2.5" Axis="{Binding ElementName=VerticalAxis}"/> <telerik:CartesianGridLineAnnotation ZIndex="-2100" Value="4" Stroke="Black" StrokeThickness="1.5" Axis="{Binding ElementName=VerticalAxis}"/> <telerik:CartesianGridLineAnnotation ZIndex="-2100" Value="1" Stroke="Black" StrokeThickness="3.5" Axis="{Binding ElementName=VerticalAxis}"/> <telerik:CartesianPlotBandAnnotation ZIndex="-200" From="0" To="1" Fill="Coral" Axis="{Binding ElementName=VerticalAxis}"/> <telerik:CartesianPlotBandAnnotation ZIndex="-200" From="7" To="8" Fill="Coral" Axis="{Binding ElementName=VerticalAxis}"/> </telerik:RadCartesianChart.Annotations> <telerik:RadCartesianChart.SeriesProvider> <telerik:ChartSeriesProvider Source="{Binding }"> <telerik:ChartSeriesProvider.SeriesDescriptors> <telerik:CategoricalSeriesDescriptor ItemsSourcePath="ResultDataPoints" CategoryPath="MeasurementTimestamp" ValuePath="Value" Style="{StaticResource PointSeriesStyle}" /> <telerik:CategoricalSeriesDescriptor ItemsSourcePath="ResultDataPoints" CategoryPath="MeasurementTimestamp" ValuePath="Value" Style="{StaticResource LineSeriesStyle}" /> </telerik:ChartSeriesProvider.SeriesDescriptors> </telerik:ChartSeriesProvider> </telerik:RadCartesianChart.SeriesProvider> <telerik:RadCartesianChart.HorizontalAxis> <!--date and time points are skipped when points are too close together--> <telerik:DateTimeContinuousAxis LabelTemplateSelector="{StaticResource HorizontalLabelTemplateSelector}" Name="HorizontalAxis" MaxHeight="8" MinHeight="0" LabelFitMode="MultiLine" LabelFormat="H:mm" LabelInterval="3" LastLabelVisibility="Visible" MajorTickLength="3" /> </telerik:RadCartesianChart.HorizontalAxis> <telerik:RadCartesianChart.VerticalAxis> <telerik:LinearAxis LabelTemplateSelector="{StaticResource VerticalLabelTemplateSelector}" Name="VerticalAxis" Maximum="8" Minimum="0"> <telerik:LinearAxis.LabelTemplate> <DataTemplate> <TextBlock Text="{Binding Converter={StaticResource TargetLabelFormatConverter}}"/> </DataTemplate> </telerik:LinearAxis.LabelTemplate> </telerik:LinearAxis> </telerik:RadCartesianChart.VerticalAxis> </telerik:RadCartesianChart>style definitions:
<Style x:Key="PointSeriesStyle" TargetType="telerik:PointSeries"> <Setter Property="LegendSettings" Value="{Binding Converter={StaticResource LegendElementConverter}}"/> <Setter Property="PointTemplateSelector" Value="{StaticResource LevyJennigsPointTemplateSelector}"></Setter> <Setter Property="AllowSelect" Value="True"></Setter> </Style> <Style x:Key="LineSeriesStyle" TargetType="telerikChart:LineSeries" />several series (points and lines colors match, legend proves it) see "several series.png"
one serie (line series skips first color) see "one serie.png"
Thanks a lot for your help in advance.