This is a migrated thread and some comments may be shown as answers.

Using series with different LegendDisplayMode

2 Answers 46 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Anatoly Chekh
Top achievements
Rank 1
Anatoly Chekh asked on 11 Jan 2011, 08:19 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Yavor
Telerik team
answered on 14 Jan 2011, 02:03 PM
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>>
0
Anatoly Chekh
Top achievements
Rank 1
answered on 14 Jan 2011, 03:24 PM
Thanks a lot. It's work!
Tags
Chart
Asked by
Anatoly Chekh
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Anatoly Chekh
Top achievements
Rank 1
Share this question
or