This question is locked. New answers and comments are not allowed.
Hi everyone,
I'm trying to dynamically databind to series information that I will be receiving from an outside source.
I have a RadTimeBar using sparklines which, when an interval is selected, will display the subset of data in a RadChart (LineSeriesDefinition). The X-Axis is DateTime, and the Y-Axis is a double.
Almost everything works, except that when I click on an interval in the RadTimeBar, the series appears in the RadChart, the dates are correctly displayed, and the labels on each point display the correct value, but the points themselves are all visually settled at 0. It is basically a straight line on the bottom of the chart with labels that have the correct values.
It is also important to note that the Sparklines displayed in the RadTimeBar are being shown properly. Only the RadChart is displaying the data in a horizontal line.
Here is my XAML, and I populate the series information in the code-behind. Please let me know if there is something I'm missing:
I want the series being shown in the RadChart to appear like the sparklines in the RadTimeBar, changing their vertical position as they should be doing (according to any example I've seen when using the RadChart in conjunction with the RadTimeBar)
Any help would be appreciated. Thanks!
I'm trying to dynamically databind to series information that I will be receiving from an outside source.
I have a RadTimeBar using sparklines which, when an interval is selected, will display the subset of data in a RadChart (LineSeriesDefinition). The X-Axis is DateTime, and the Y-Axis is a double.
Almost everything works, except that when I click on an interval in the RadTimeBar, the series appears in the RadChart, the dates are correctly displayed, and the labels on each point display the correct value, but the points themselves are all visually settled at 0. It is basically a straight line on the bottom of the chart with labels that have the correct values.
It is also important to note that the Sparklines displayed in the RadTimeBar are being shown properly. Only the RadChart is displaying the data in a horizontal line.
Here is my XAML, and I populate the series information in the code-behind. Please let me know if there is something I'm missing:
<UserControl x:Class="SiteDataChart.MainPage" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:me="clr-namespace:SiteDataChart" DataContext="{Binding RelativeSource={RelativeSource Self}}" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <UserControl.Resources> <me:DataOverTime x:Key="ViewModel" x:Name="viewModel" /> <Style x:Key="TransitionControlStyle" TargetType="telerik:RadTransitionControl"> <Setter Property="Transition"> <Setter.Value> <telerik:FadeTransition /> </Setter.Value> </Setter> </Style> </UserControl.Resources> <Grid x:Name="LayoutRoot" Background="White" DataContext="{StaticResource ViewModel}"> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <Button Content="Refresh" Click="Button_Click" Height="20" VerticalAlignment="Top" /> <telerik:RadTimeBar x:Name="DataTimeBar" Grid.Row="0" Margin="0,20,0,0" PeriodStart="{Binding Path=StartDate, Mode=TwoWay}" PeriodEnd="{Binding Path=EndDate, Mode=TwoWay}" VisiblePeriodStart="{Binding Path=VisibleStartDate, Mode=TwoWay}" VisiblePeriodEnd="{Binding Path=VisibleEndDate, Mode=TwoWay}" IsSnapToIntervalEnabled="True"> <telerik:RadTimeBar.Intervals> <telerik:WeekInterval /> <telerik:DayInterval /> <telerik:HourInterval /> </telerik:RadTimeBar.Intervals> <telerik:RadLinearSparkline ItemsSource="{Binding Path=DataPoints}" XValuePath="TimeStamp" YValuePath="Value" /> </telerik:RadTimeBar> <telerik:RadChart Grid.Row="1" x:Name="Chart"> <telerik:RadChart.TimeBar> <Binding ElementName="DataTimeBar" /> </telerik:RadChart.TimeBar> <telerik:RadChart.ItemsSource> <Binding Path="DataPoints" /> </telerik:RadChart.ItemsSource> <telerik:RadChart.SeriesMappings> <telerik:SeriesMapping LegendLabel="{Binding Path=UnitLabel}" > <telerik:SeriesMapping.SeriesDefinition> <telerik:LineSeriesDefinition /> </telerik:SeriesMapping.SeriesDefinition> <telerik:SeriesMapping.ItemMappings> <telerik:ItemMapping FieldName="TimeStamp" DataPointMember="XCategory" /> <telerik:ItemMapping FieldName="Value" DataPointMember="YValue" /> </telerik:SeriesMapping.ItemMappings> </telerik:SeriesMapping> </telerik:RadChart.SeriesMappings> <telerik:RadChart.DefaultView> <telerik:ChartDefaultView> <telerik:ChartDefaultView.ChartLegend> <telerik:ChartLegend x:Name="legend" Header="Legend" /> </telerik:ChartDefaultView.ChartLegend> <telerik:ChartDefaultView.ChartTitle> <telerik:ChartTitle Content="Selected Data Points" /> </telerik:ChartDefaultView.ChartTitle> <telerik:ChartDefaultView.ChartArea> <telerik:ChartArea LegendName="legend" EnableAnimations="False" EnableTransitionAnimations="True" TransitionControlStyle="{StaticResource TransitionControlStyle}"> <telerik:ChartArea.AxisX> <telerik:AxisX AxisName="Time" IsDateTime="True" LabelStep="6" /> </telerik:ChartArea.AxisX> <telerik:ChartArea.AxisY> <telerik:AxisY AxisName="{Binding Path=UnitLabel}" /> </telerik:ChartArea.AxisY> </telerik:ChartArea> </telerik:ChartDefaultView.ChartArea> </telerik:ChartDefaultView> </telerik:RadChart.DefaultView> </telerik:RadChart> </Grid> </UserControl> I want the series being shown in the RadChart to appear like the sparklines in the RadTimeBar, changing their vertical position as they should be doing (according to any example I've seen when using the RadChart in conjunction with the RadTimeBar)
Any help would be appreciated. Thanks!