Using series with different LegendDisplayMode

3 posts, 1 answers
  1. Anatoly Chekh
    Anatoly Chekh avatar
    86 posts
    Member since:
    Apr 2010

    Posted 11 Jan 2011 Link to this post

    Hello.

    I have a problem: I have two series (bar and spline). LegendDisplayMode for the Bar series is set to the DataPointLabel, LegendDisplayMode for the Line series is set to the SeriesLabel. I have 4 points in the bar. I set palette for the chart with 5 different colors. But color for the secont series (Line) is equals to the second defined color (for the first series).

    Is this a bug or how can I fix it?

    Note: I use DataPointLabel because I need the space beetwen bars. Is the SeriesLabel case and multuple series with one point I have very large space between bars.

    Thanks, Anatoly Chekh.
  2. Answer
    Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 14 Jan 2011 Link to this post

    Hello Anatoly Chekh,

    By default the chart series take colors from your palette in the order in which they are added to the Chart - the first series takes the first color, the second series - the second color. In your case the first series takes 4 colors from the palette for each item in the legend and the second series takes the second color as this is the default behavior.

    One way of overcoming this behavior is to define the series colors manually like this:

    <telerik:SeriesMapping.SeriesDefinition>
        <telerik:LineSeriesDefinition>
            <telerik:LineSeriesDefinition.Appearance>
                <telerik:SeriesAppearanceSettings Fill="Green" Stroke="Green">
                    <telerik:SeriesAppearanceSettings.PointMark>
                        <telerik:PointMarkAppearanceSettings Stroke="Green" />
                    </telerik:SeriesAppearanceSettings.PointMark>
                </telerik:SeriesAppearanceSettings>
            </telerik:LineSeriesDefinition.Appearance>
        </telerik:LineSeriesDefinition>
    </telerik:SeriesMapping.SeriesDefinition>
    You can find more information in this topic in our help system.

    Hope this helps!


    Best wishes,
    Yavor Ivanov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. Anatoly Chekh
    Anatoly Chekh avatar
    86 posts
    Member since:
    Apr 2010

    Posted 14 Jan 2011 Link to this post

    Thanks a lot. It's work!
Back to Top