Chart problem

2 posts, 0 answers
  1. Anikin Victor
    Anikin Victor avatar
    1 posts
    Member since:
    Apr 2010

    Posted 01 Nov 2012 Link to this post

    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>
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 05 Nov 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top