Hi,
I am using a RadChart control with multiple RadChartAreas defined. I wanted to show individual legends belonging to each Chart area but they aren't visible. Even though I followed the examples but couldn't get the legends to display.
Here's my source code:
<telerik:RadChart x:Name="LineChartCusips" ScrollViewer.CanContentScroll="True">
<Grid Margin="0,0,10,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<telerik:ChartTitle Grid.Row="0"
Grid.ColumnSpan="2"
Content="Year 2010"
HorizontalAlignment="Center"
Style="{StaticResource CustomTitleStyle}"/>
<telerik:ChartArea Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
Padding="5,10,20,5"
x:Name="splineChartArea"
LegendName="splineLengend"
ItemToolTipOpening="splineChartArea_ItemToolTipOpening"/>
<telerik:ChartTitle Grid.Row="2"
Content="Monthly Distribution"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
Style="{StaticResource CustomTitleStyle}"/>
<telerik:ChartArea Grid.Row="3"
Grid.Column="0"
x:Name="barChartArea"
LegendName="barLegend"
ItemToolTipOpening="ChartArea2_ItemToolTipOpening"/>
<telerik:ChartArea Grid.Row="3"
Grid.Column="1"
x:Name="pieChartArea"
/>
</Grid>
For one of the chart areas, splineLengend, here's the code behind:
DataSeries newSeries = new DataSeries();
newSeries.LegendLabel = tranchedata.Key.ToString();
newSeries.Definition = new LineSeriesDefinition();
newSeries.Definition.InteractivitySettings.HoverScope = InteractivityScope.Series;
newSeries.Definition.InteractivitySettings.SelectionScope = InteractivityScope.Series;
newSeries.Definition.ShowItemLabels = true;
newSeries.Definition.ShowItemToolTips = true;
Thanks,
Farhan
I am using a RadChart control with multiple RadChartAreas defined. I wanted to show individual legends belonging to each Chart area but they aren't visible. Even though I followed the examples but couldn't get the legends to display.
Here's my source code:
<telerik:RadChart x:Name="LineChartCusips" ScrollViewer.CanContentScroll="True">
<Grid Margin="0,0,10,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<telerik:ChartTitle Grid.Row="0"
Grid.ColumnSpan="2"
Content="Year 2010"
HorizontalAlignment="Center"
Style="{StaticResource CustomTitleStyle}"/>
<telerik:ChartArea Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
Padding="5,10,20,5"
x:Name="splineChartArea"
LegendName="splineLengend"
ItemToolTipOpening="splineChartArea_ItemToolTipOpening"/>
<telerik:ChartTitle Grid.Row="2"
Content="Monthly Distribution"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
Style="{StaticResource CustomTitleStyle}"/>
<telerik:ChartArea Grid.Row="3"
Grid.Column="0"
x:Name="barChartArea"
LegendName="barLegend"
ItemToolTipOpening="ChartArea2_ItemToolTipOpening"/>
<telerik:ChartArea Grid.Row="3"
Grid.Column="1"
x:Name="pieChartArea"
/>
</Grid>
For one of the chart areas, splineLengend, here's the code behind:
DataSeries newSeries = new DataSeries();
newSeries.LegendLabel = tranchedata.Key.ToString();
newSeries.Definition = new LineSeriesDefinition();
newSeries.Definition.InteractivitySettings.HoverScope = InteractivityScope.Series;
newSeries.Definition.InteractivitySettings.SelectionScope = InteractivityScope.Series;
newSeries.Definition.ShowItemLabels = true;
newSeries.Definition.ShowItemToolTips = true;
Thanks,
Farhan