RadCartesianChart - Legend missing line-color indicator

2 posts, 0 answers
  1. paul
    paul avatar
    2 posts
    Member since:
    Apr 2015

    Posted 08 Apr 2015 Link to this post

    Hello All,

    Unable to display line-color indicator in the legend box for the "Price" series. I would expect to see a gray square immediately to the left of Price inside the legend. See attachment.

    Here is the markup:

      <telerik:RadCartesianChart Grid.Row="1" Grid.Column="0" VerticalAlignment="Stretch" Margin="0,0,20,0"
                                       Palette="Windows8" Name="HistoryChart"
                                       TrackBallLineStyle="{StaticResource TrackBallLineStyle}"
                                       TrackBallInfoStyle="{StaticResource TrackBallInfoStyle}">
                    <telerik:DateTimeContinuousAxis LabelFitMode="MultiLine"
                                                    LabelInterval="1" LabelFormat="MMM d" />
                    <telerik:ChartTrackBallBehavior ShowIntersectionPoints="True" SnapMode="AllClosePoints"
                                                    TrackInfoUpdated="ChartTrackBallBehavior_TrackInfoUpdated" />
                    <telerik:LinearAxis LabelStyle="{StaticResource LeftLabelStyle}" />
                    <telerik:AreaSeries CategoryBinding="BusinessDate"
                                        ItemsSource="{Binding ChartingWrapper.ChartingData}"
                                        Fill="{Binding ChartingWrapper.ChartingData, Converter={StaticResource ChartDataGradiantConverter}}"
                                        StrokeMode="Points" Stroke="{StaticResource MktPriceBrush}" StrokeThickness="2">
                            <telerik:SeriesLegendSettings Title="Price" />
                    <telerik:LineSeries ValueBinding="TargetPriceUp" Stroke="{StaticResource UpsideBrush}">
                            <telerik:SeriesLegendSettings Title="Target Price Up" />
                    <telerik:LineSeries ValueBinding="TargetPriceDown" Stroke="{StaticResource DownsideBrush}">
                            <telerik:SeriesLegendSettings Title="Target Price Down" />
                    <telerik:CartesianChartGrid StripLinesVisibility="None" MajorLinesVisibility="X" />
            <telerik:RadLegend BorderThickness="1" BorderBrush="LightGray"
                               Items="{Binding LegendItems, ElementName=HistoryChart}"
                               Margin="50,10" Grid.Row="1" Grid.Column="0"
                               VerticalAlignment="Top" />


  2. Petar Marchev
    Petar Marchev avatar
    996 posts

    Posted 13 Apr 2015 Link to this post

    Hello Paul,

    I have attached a small project based on the code you provided. As you can see in the attached image, the marker brush is gray, as is the fill of the area series.

    In your case, I do not see the fill of the area series, it seems to be transparent. This is why the marker brush is also transparent - by default the fill of the legend marker is bound to the fill of the area series. I am unsure why the fill of the area series is transparent in your case, perhaps you have some settings in code behind. If you were to remove these settings, the area series should display with the color from the palette and the legend marker will be correctly applied. If you need the fill of the area series to be transparent, you can use a line series instead. Another approach would be to set an item template for the legend where you pick the color of the marker by some custom logic.

    Let us know if I was able to address the issue at hand properly and whether you need more information.

    Petar Marchev

    See What's Next in App Development. Register for TelerikNEXT.

Back to Top