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

Setting alignment of the donut

1 Answer 140 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Nicole
Top achievements
Rank 1
Nicole asked on 21 Feb 2013, 11:20 AM
Hello,

we use a donut chart for some statistics. Is it possible, to change the alignment of the donut?


<Window x:Class="WpfApplication1.Window1"
    xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"       
    Title="Window1" Height="300" Width="300">
 
    <WrapPanel Orientation="Vertical">
        <Border telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True">
            <telerik:RadChart x:Name="RadChart1" ItemsSource="{Binding StaticResource Umsatzdaten}" VerticalContentAlignment="Top">
                <telerik:RadChart.Content>
                    <Label Content="Umsätze der letzten 6 Monate" FontWeight="Bold"/>
                </telerik:RadChart.Content>
                 
                <telerik:RadChart.DefaultSeriesDefinition>
                    <telerik:DoughnutSeriesDefinition LegendDisplayMode="None">
                        <telerik:DoughnutSeriesDefinition.InteractivitySettings>
                            <telerik:InteractivitySettings HoverScope="Item" SelectionScope="Item" SelectionMode="Single" />
                        </telerik:DoughnutSeriesDefinition.InteractivitySettings>
                    </telerik:DoughnutSeriesDefinition>
                </telerik:RadChart.DefaultSeriesDefinition>
 
                <telerik:RadChart.SeriesMappings>
                    <telerik:SeriesMapping>
                        <telerik:SeriesMapping.ItemMappings>
                            <telerik:ItemMapping DataPointMember="YValue" FieldName="Umsatz" />
                            <telerik:ItemMapping DataPointMember="Label" FieldName="MonatsnameMitUmsatz" />
                            <telerik:ItemMapping DataPointMember="LegendLabel" FieldName="Monatsname" />
                            <telerik:ItemMapping DataPointMember="XCategory" FieldName="Monat" />
                        </telerik:SeriesMapping.ItemMappings>
                    </telerik:SeriesMapping>
                </telerik:RadChart.SeriesMappings>
            </telerik:RadChart>
        </Border>
    </WrapPanel>   
</Window>

Please take a look at the attached screenshots to understand what we want to do :)


Best regards

J

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 25 Feb 2013, 05:13 PM
Hello Josef,

 Since you haven't provided Width/Height for the Chart and it is the onliest element of your wrapper - the WrapPanel, it will occupy the all space available and the doughnut itself will be shown centered. Set ItemWidth/ItemHeight of the RadWrapPanel or set Width/Height for the Chart and it will be positioned Top Left inside the wrapper as expected.

Kind regards,
Evgenia
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Chart
Asked by
Nicole
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or