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

Chart problem

1 Answer 39 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Anikin Victor
Top achievements
Rank 1
Anikin Victor asked on 01 Nov 2012, 12:00 PM
I use the StackedBarSeries to display data.While drawing some of the columns are overwritten by other columns. Tell me how to fix this?
Q2 2012 SP2

<telerik:RadChart>
                    <telerik:RadChart.SeriesMappings>
                        <telerikCharting:SeriesMapping ItemsSource="{Binding Source={StaticResource lastDaysVM}, Path=Count.InboxServed}" LegendLabel="↓ Вручено">
                            <telerikCharting:SeriesMapping.SeriesDefinition>
                                <telerikCharting:StackedBarSeriesDefinition StackGroupName="Inbox"></telerikCharting:StackedBarSeriesDefinition>
                            </telerikCharting:SeriesMapping.SeriesDefinition>
                            <telerikCharting:SeriesMapping.ItemMappings>
                                <telerikCharting:ItemMapping FieldName="Date" DataPointMember="XCategory"></telerikCharting:ItemMapping>
                                <telerikCharting:ItemMapping FieldName="Count" DataPointMember="YValue"></telerikCharting:ItemMapping>
                            </telerikCharting:SeriesMapping.ItemMappings>
                        </telerikCharting:SeriesMapping>
                         
                        <telerikCharting:SeriesMapping ItemsSource="{Binding Source={StaticResource lastDaysVM}, Path=Count.InboxNotServed}" LegendLabel="↓ Не вручено">
                            <telerikCharting:SeriesMapping.SeriesDefinition>
                                <telerikCharting:StackedBarSeriesDefinition StackGroupName="Inbox"></telerikCharting:StackedBarSeriesDefinition>
                            </telerikCharting:SeriesMapping.SeriesDefinition>
                            <telerikCharting:SeriesMapping.ItemMappings>
                                <telerikCharting:ItemMapping FieldName="Date" DataPointMember="XCategory"></telerikCharting:ItemMapping>
                                <telerikCharting:ItemMapping FieldName="Count" DataPointMember="YValue"></telerikCharting:ItemMapping>
                            </telerikCharting:SeriesMapping.ItemMappings>
                        </telerikCharting:SeriesMapping>
                         
                        <telerikCharting:SeriesMapping ItemsSource="{Binding Source={StaticResource lastDaysVM}, Path=Count.InboxNotServedRejected}" LegendLabel="↓ Отклонено">
                            <telerikCharting:SeriesMapping.SeriesDefinition>
                                <telerikCharting:StackedBarSeriesDefinition StackGroupName="Inbox"></telerikCharting:StackedBarSeriesDefinition>
                            </telerikCharting:SeriesMapping.SeriesDefinition>
                            <telerikCharting:SeriesMapping.ItemMappings>
                                <telerikCharting:ItemMapping FieldName="Date" DataPointMember="XCategory"></telerikCharting:ItemMapping>
                                <telerikCharting:ItemMapping FieldName="Count" DataPointMember="YValue"></telerikCharting:ItemMapping>
                            </telerikCharting:SeriesMapping.ItemMappings>
                        </telerikCharting:SeriesMapping>
                         
                        <telerikCharting:SeriesMapping ItemsSource="{Binding Source={StaticResource lastDaysVM}, Path=Count.OutboxSend}" LegendLabel="↑ Отправлено">
                            <telerikCharting:SeriesMapping.SeriesDefinition>
                                <telerikCharting:StackedBarSeriesDefinition StackGroupName="Outbox"></telerikCharting:StackedBarSeriesDefinition>
                            </telerikCharting:SeriesMapping.SeriesDefinition>
                            <telerikCharting:SeriesMapping.ItemMappings>
                                <telerikCharting:ItemMapping FieldName="Date" DataPointMember="XCategory"></telerikCharting:ItemMapping>
                                <telerikCharting:ItemMapping FieldName="Count" DataPointMember="YValue"></telerikCharting:ItemMapping>
                            </telerikCharting:SeriesMapping.ItemMappings>
                        </telerikCharting:SeriesMapping>
                         
                        <telerikCharting:SeriesMapping ItemsSource="{Binding Source={StaticResource lastDaysVM}, Path=Count.OutboxNotSend}" LegendLabel="↑ Не отправлено">
                            <telerikCharting:SeriesMapping.SeriesDefinition>
                                <telerikCharting:StackedBarSeriesDefinition StackGroupName="Outbox"></telerikCharting:StackedBarSeriesDefinition>
                            </telerikCharting:SeriesMapping.SeriesDefinition>
                            <telerikCharting:SeriesMapping.ItemMappings>
                                <telerikCharting:ItemMapping FieldName="Date" DataPointMember="XCategory"></telerikCharting:ItemMapping>
                                <telerikCharting:ItemMapping FieldName="Count" DataPointMember="YValue"></telerikCharting:ItemMapping>
                            </telerikCharting:SeriesMapping.ItemMappings>
                        </telerikCharting:SeriesMapping>
                         
                        <telerikCharting:SeriesMapping ItemsSource="{Binding Source={StaticResource lastDaysVM}, Path=Count.OutboxNotSendRejected}" LegendLabel="↑ Отклонено">
                            <telerikCharting:SeriesMapping.SeriesDefinition>
                                <telerikCharting:StackedBarSeriesDefinition StackGroupName="Outbox"></telerikCharting:StackedBarSeriesDefinition>
                            </telerikCharting:SeriesMapping.SeriesDefinition>
                            <telerikCharting:SeriesMapping.ItemMappings>
                                <telerikCharting:ItemMapping FieldName="Date" DataPointMember="XCategory"></telerikCharting:ItemMapping>
                                <telerikCharting:ItemMapping FieldName="Count" DataPointMember="YValue"></telerikCharting:ItemMapping>
                            </telerikCharting:SeriesMapping.ItemMappings>
                        </telerikCharting:SeriesMapping>
                    </telerik:RadChart.SeriesMappings>
                     
                    <telerik:RadChart.DefaultView>
                        <telerikCharting:ChartDefaultView ChartLegendPosition="Bottom">
                            <telerikCharting:ChartDefaultView.ChartLegend>
                                <telerikCharting:ChartLegend x:Name="chartLegend" Header="Корреспонденция"></telerikCharting:ChartLegend>
                            </telerikCharting:ChartDefaultView.ChartLegend>
                            <telerikCharting:ChartDefaultView.ChartArea>
                                <telerikCharting:ChartArea LegendName="chartLegend">
                                    <telerik:ChartArea.AxisY>
                                        <telerikCharting:AxisY MinValue="0" MinorTickPointMultiplier="1"></telerikCharting:AxisY>
                                    </telerik:ChartArea.AxisY>
                                    <telerikCharting:ChartArea.AxisX>
                                        <telerikCharting:AxisX DefaultLabelFormat="dd-MMM" LabelRotationAngle="90"></telerikCharting:AxisX>
                                    </telerikCharting:ChartArea.AxisX>
                                </telerikCharting:ChartArea>
                            </telerikCharting:ChartDefaultView.ChartArea>
                        </telerikCharting:ChartDefaultView>
                    </telerik:RadChart.DefaultView>
                </telerik:RadChart>

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 05 Nov 2012, 09:24 AM
Hi Anikin,

This is a common problem with stacked bar series - when there are some bars that are close together - there is no space for all labels. You can try to enable the smart labels and see how that goes:
<telerik:ChartArea SmartLabelsEnabled="true" />
 
Another solution is for you to show only one label per stack - instead of three labels, show only one - with the sum in it. Let us know if you need further assistance.

All the best,
Petar Marchev
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Chart
Asked by
Anikin Victor
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or