hello,
I am learning RadChart to display a pie,when I place a RadChart and ChartLegend in RadDocking,the pie chart can be drawn,but the chartlegend items are missing!
I have built a sample application to show the bug,please help me!
Any help will be appreciated!
Jerry
Screen shot
xaml:
Behind code:
I am learning RadChart to display a pie,when I place a RadChart and ChartLegend in RadDocking,the pie chart can be drawn,but the chartlegend items are missing!
I have built a sample application to show the bug,please help me!
Any help will be appreciated!
Jerry
Screen shot
xaml:
<Grid> <telerik:RadDocking Background="Transparent" d:IsHidden="True" > <telerik:RadSplitContainer telerik:DockingPanel.InitialSize="200,150" MaxWidth="600" Name="leftContainer" InitialPosition="DockedLeft"> <telerik:RadPaneGroup DropDownDisplayMode="Collapsed"> <telerik:RadPane x:Name="featurePane" Header="Featrues" > <Controls:RadTreeView SelectionMode="Extended" IsLineEnabled="False" ItemsOptionListType="CheckList" IsOptionElementsEnabled="True" IsRootLinesEnabled="True" VerticalAlignment="Stretch" Margin="0" x:Name="featureTree" IsTriStateMode="True" > </Controls:RadTreeView> </telerik:RadPane> </telerik:RadPaneGroup> </telerik:RadSplitContainer> <telerik:RadDocking.DocumentHost> <Grid> <Grid.RowDefinitions> <RowDefinition Height="100"/> <RowDefinition Height="310*"/> </Grid.RowDefinitions> <Controls1:RadChart x:Name="radPipe" Grid.Row="0" UseDefaultLayout="False"> <Charting:ChartArea x:Name="pipeArea" > </Charting:ChartArea> </Controls1:RadChart> <Controls1:RadChart x:Name="radStatistics" Grid.Row="1" UseDefaultLayout="False" BorderBrush="Transparent"> <Grid > <Grid.ColumnDefinitions> <ColumnDefinition Width="165*" /> <ColumnDefinition Width="120" /> </Grid.ColumnDefinitions> <Charting:ChartLegend Grid.Column="1" Name="pieLegend" /> <Charting:ChartArea x:Name="pieArea" Grid.Column="0" LegendName="pieLegend" /> </Grid> </Controls1:RadChart> </Grid> </telerik:RadDocking.DocumentHost> </telerik:RadDocking> <Button Content="Button" Height="27" HorizontalAlignment="Left" Margin="62,105,0,0" Name="button1" VerticalAlignment="Top" Width="96" Click="button1_Click" /> </Grid>Behind code:
public partial class MainWindow : Window{ public MainWindow() { this.InitializeComponent(); } private static DataSeries GetPieData() { DataSeries series = new DataSeries(); for(int i=0;i<5;i++) { DataPoint dataPoint = new DataPoint("aa"+i, i); dataPoint.LegendLabel="aa"+i; series.Add(dataPoint); } return series; } private void ConfigurePie() { DataSeries doughnutSeries = GetPieData(); doughnutSeries.LegendLabel = "Doughnut Series"; doughnutSeries.Definition = new DoughnutSeriesDefinition(); doughnutSeries.Definition.InteractivitySettings.HoverScope = InteractivityScope.Item; doughnutSeries.Definition.InteractivitySettings.SelectionScope = InteractivityScope.Item; doughnutSeries.Definition.InteractivitySettings.SelectionMode = ChartSelectionMode.Single; ((DoughnutSeriesDefinition)doughnutSeries.Definition).LabelSettings.LabelOffset = 0.8d; doughnutSeries.Definition.ItemLabelFormat = "#Y"; pieArea.DataSeries.Clear(); pieArea.DataSeries.Add(doughnutSeries); pieArea.SmartLabelsEnabled = true; pieLegend.Header = " "; } private void button1_Click(object sender, RoutedEventArgs e) { ConfigurePie(); } }