Color each XCategory Item

2 posts, 0 answers
  1. Dario
    Dario avatar
    61 posts
    Member since:
    Apr 2011

    Posted 26 Mar 2013 Link to this post

    Can I choose single color for each XCategory Item?

    Thi is my chart

    <telerik:RadChart ItemsSource="{Binding Situazione}" Margin="2">
        <telerik:RadChart.DefaultView>
            <telerik:ChartDefaultView>
                <telerik:ChartDefaultView.ChartLegend>
                    <telerik:ChartLegend UseAutoGeneratedItems="True" Visibility="Collapsed" />
                </telerik:ChartDefaultView.ChartLegend>
            </telerik:ChartDefaultView>
        </telerik:RadChart.DefaultView>
        <telerik:RadChart.SeriesMappings>
            <telerik:SeriesMappingCollection>
                <telerik:SeriesMapping>
                    <telerik:SeriesMapping.SeriesDefinition>
                        <telerik:BarSeriesDefinition  />
                    </telerik:SeriesMapping.SeriesDefinition>
                    <telerik:SeriesMapping.ItemMappings>
                        <telerik:ItemMapping DataPointMember="YValue" FieldName="Conteggio" />
                        <telerik:ItemMapping DataPointMember="XCategory" FieldName="Tipo" />
                    </telerik:SeriesMapping.ItemMappings>
                </telerik:SeriesMapping>
            </telerik:SeriesMappingCollection>
        </telerik:RadChart.SeriesMappings>
    </telerik:RadChart>
  2. Missing user
    Missing user avatar

    Posted 29 Mar 2013 Link to this post

    Hi Dario,

    You should use the LegendDisplayMode property of the BarSeriesDefinition. Setting it to DataPointLabel will color each bar in a category with a different color, even though they belong to the same series, as shown in this help topic.

    Regards,
    Ivan N.
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top