Is there a way to add DataSeries to a ChartArea, which does not have a name?
I would like to create a custom layout for the ChartTitle, ChartArea, and ChartLegend in XAML but I only have access to the RadChart in code (not the ChartArea). I know I can get to the DefaultView ChartArea through the RadChart object. I could access the Content property of the RadChart and get the first ChartArea type, but that's not very elegant and is too dependent on the visual tree.
Any ideas?
I would like to create a custom layout for the ChartTitle, ChartArea, and ChartLegend in XAML but I only have access to the RadChart in code (not the ChartArea). I know I can get to the DefaultView ChartArea through the RadChart object. I could access the Content property of the RadChart and get the first ChartArea type, but that's not very elegant and is too dependent on the visual tree.
Any ideas?
| <telerikChart:RadChart |
| x:Name="SeasonsChart" |
| VerticalAlignment="Stretch" |
| HorizontalAlignment="Stretch" |
| UseDefaultLayout="False" |
| Background="Transparent"> |
| <Grid> |
| <Grid.RowDefinitions> |
| <RowDefinition Height="50"/> |
| <RowDefinition Height="*"/> |
| </Grid.RowDefinitions> |
| <Grid.ColumnDefinitions> |
| <ColumnDefinition Width="*"/> |
| <ColumnDefinition Width="Auto"/> |
| </Grid.ColumnDefinitions> |
| <Border x:Name="SeasonsImage" Grid.ColumnSpan="2" Grid.RowSpan="2" ></Border> |
| <telerikCharting:ChartTitle |
| Margin="20, 0, 0, 0" |
| Padding="5,5,5,5" |
| Foreground="GhostWhite" |
| Grid.Row="0" |
| Grid.Column="0" |
| HorizontalAlignment="Left" |
| VerticalAlignment="Bottom"/> |
| <telerikCharting:ChartArea |
| LegendName="SeasonsLegend" |
| Background="{StaticResource springTransparentBrush}" |
| Padding="20, 20, 0, 30" |
| Grid.Row="1" |
| Grid.Column="0"/> |
| <telerikCharting:ChartLegend |
| Header="Temperatures" |
| Visibility="Visible" |
| Background="{StaticResource springTransparentBrush}" |
| Grid.Column="1" |
| Grid.Row="1" |
| Padding="-10, 20, 20, 30"/> |
| <input:RadComboBox x:Name="SeasonCombo" |
| SelectionChanged="SeasonCombo_SelectionChanged" |
| HorizontalAlignment="Right" |
| VerticalAlignment="Bottom" |
| Margin="0, 0, 20, 0" |
| Grid.Row="0" |
| Grid.Column="0" |
| MaxWidth="150" |
| MaxHeight="30" |
| telerik:StyleManager.Theme="{StaticResource QsfTheme}"> |
| <input:RadComboBoxItem Content="Spring"></input:RadComboBoxItem> |
| <input:RadComboBoxItem Content="Summer"></input:RadComboBoxItem> |
| <input:RadComboBoxItem Content="Autumn"></input:RadComboBoxItem> |
| <input:RadComboBoxItem Content="Winter"></input:RadComboBoxItem> |
| </input:RadComboBox> |
| </Grid> |
| </telerikChart:RadChart> |