Hey all,
I am trying to customize my RadChart layout and have something very similiar to the following:
<UserControl |
x:Class="TelerikTest.Page2" |
xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" |
xmlns:Chart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting" |
xmlns:Charting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" |
xmlns:gauge="clr-namespace:Telerik.Windows.Controls.Gauges;assembly=Telerik.Windows.Controls.Gauge" |
xmlns:control="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Gauge" |
> |
<Grid x:Name="LayoutRoot" Background="White"> |
<Grid.RowDefinitions> |
<RowDefinition Height="9*"/> |
<RowDefinition Height="1*"/> |
</Grid.RowDefinitions> |
<Border BorderBrush="Aquamarine" BorderThickness="10" Grid.Row="0"> |
<Chart:RadChart x:Name="Chart1" UseDefaultLayout="False" Grid.Row="0"> |
<Chart:RadChart.LegendStyle> |
<Style TargetType="Charting:ChartLegend"> |
<Setter Property="ItemsPanel" > |
<Setter.Value> |
<ItemsPanelTemplate> |
<StackPanel Orientation="Horizontal" /> |
</ItemsPanelTemplate> |
</Setter.Value> |
</Setter> |
</Style> |
</Chart:RadChart.LegendStyle> |
<Grid> |
<Grid.RowDefinitions> |
<RowDefinition Height="1*" /> |
<RowDefinition Height="8*" /> |
<RowDefinition Height="1*" /> |
</Grid.RowDefinitions> |
<Charting:ChartArea x:Name="ChartArea1" LegendName="ChartLegend1" |
Grid.Row="1" /> |
<Charting:ChartTitle Content="Sample Report" Grid.Row="0" |
VerticalAlignment="Top" HorizontalAlignment="Center" |
/> |
<Charting:ChartLegend x:Name="ChartLegend1" Header="Legend:" |
Grid.Row="2" |
VerticalAlignment="Top"/> |
</Grid> |
</Chart:RadChart> |
</Border> |
<Button x:Name="Btn" Content="Load" Click="Btn_Click" Grid.Row="1"/> |
</Grid> |
</UserControl> |
Also (not shown above), I have a RadGridView that has a DateTime value in the first column, and a few more columns (Value1, Value2, etc).
I want it to plot each of the Values columns on the Y-axis and the DateTime on the x-axis. So in the code-behind, I have the SeriesMapping created with the ItemMappings set up properly and I add the each of the SeriesMappings to Chart1.
So when the user selects some rows, I have in the SelectionChanged event handler to update the Chart1.ItemsSource field but the points do not get graphed! (this is the problem)
When I don't use my customized layout (and just UseDefaultLayout = True), my points do get graphed. I've also tried setting the ChartArea1.ItemsSource field to the selected items but that didn't work either.
Any help would be appreciated! If you need more info, let me know.
-David