Error when using LabelRotationAngle

2 posts, 0 answers
  1. Stuart
    Stuart avatar
    30 posts
    Member since:
    Jun 2010

    Posted 21 Sep 2010 Link to this post

    Hi

    I have a simple chart declared declaratively and bound to my viewmodel using the following

    <telerik:RadChart ItemsSource="{Binding Data}" Margin="10" Padding="10">
                        <telerik:RadChart.DefaultView>
                            <telerik:ChartDefaultView>
                                <telerik:ChartDefaultView.ChartArea>
                                    <telerik:ChartArea>
                                        <!--<telerik:AxisX LabelRotationAngle="90" />-->
                                    </telerik:ChartArea>
                                </telerik:ChartDefaultView.ChartArea>
                            </telerik:ChartDefaultView>
                        </telerik:RadChart.DefaultView>
                        <telerik:RadChart.SeriesMappings>
                            <telerik:SeriesMapping LegendLabel="Label1">
                                <telerik:SeriesMapping.SeriesDefinition>
                                    <telerik:BarSeriesDefinition ShowItemLabels="True"/>
                                </telerik:SeriesMapping.SeriesDefinition>
                                <telerik:SeriesMapping.ItemMappings>
                                    <telerik:ItemMapping DataPointMember="XCategory" FieldName="Country"/>
                                    <telerik:ItemMapping DataPointMember="YValue" FieldName="Value1"/>

                                </telerik:SeriesMapping.ItemMappings>
                            </telerik:SeriesMapping>
                        </telerik:RadChart.SeriesMappings>
                    </telerik:RadChart>



    In addition I would like to rotate the category values along the bottom by 90 degrees. However when I uncomment the line with the LabelRotateAngle attribute in suddenly my whole SLapp collapses and refuses to render the page - it complains about the itemsource not being empty etc.


    Can anyone help?

    Thanks







  2. Stuart
    Stuart avatar
    30 posts
    Member since:
    Jun 2010

    Posted 21 Sep 2010 Link to this post

    Okay, ignore me, I've seen the error of my ways.

    I had to use

    <telerik:ChartArea.AxisX>
        <telerik:AxisX LabelRotationAngle="90"/>
    </telerik:ChartArea.AxisX>

    rather than what I had above.

    Thanks anyway
Back to Top