RadTimeBar & RadChart XAxis

2 posts, 0 answers
  1. Paolo
    Paolo avatar
    423 posts
    Member since:
    Jun 2009

    Posted 05 Jun 2012 Link to this post

    Hello,
    I'm trying to use a RadTimeBar with a Radchart..... I've set the timbar to the begin of the day and ends to day.AddDays(1).AddMilliseconds(-1) ... the data I set on the chart aren't positioned to the radtimebar time's position

    here's my code

    <telerik:RadTimeBar Name="timeBar1" Grid.Row="1"  Width="1200"
                          PeriodStart="{Binding DashBoard.SelectedDataItem.FirstTS,Mode=OneWay}" PeriodEnd="{Binding DashBoard.SelectedDataItem.LastTS,Mode=OneWay}" Background="{x:Null}"
                          VisiblePeriodStart="{Binding DashBoard.SelectedDataItem.FirstTS,Mode=OneWay}" VisiblePeriodEnd="{Binding DashBoard.SelectedDataItem.LastTS,Mode=OneWay}"
                          SelectionStart="{Binding DashBoard.SelectionDateStart,Mode=TwoWay}" SelectionEnd="{Binding DashBoard.SelectionDateEnd,Mode=TwoWay}"
                          IsSnapToIntervalEnabled="True"
                          FontFamily="{Binding Source={StaticResource paletteManager}, Path=Palette.font,Mode=TwoWay}"    
                          Style="{StaticResource RadTimeBarStyle}"
                          BorderBrush="{x:Null}" BorderThickness="0" Foreground="{StaticResource text}" 
                             >
              <i:Interaction.Behaviors>
                  <local:RadTimeBarBehavior/>
                   
              </i:Interaction.Behaviors>
              <i:Interaction.Triggers>
                  <i:EventTrigger EventName="SelectionChanged">
                      <ei:CallMethodAction MethodName="SelectionPeriodChanged" TargetObject="{Binding}"></ei:CallMethodAction>
                  </i:EventTrigger>
              </i:Interaction.Triggers>
                  <telerik:RadTimeBar.Intervals>
                  <!--<telerik:DayInterval />-->
                  <telerik:HourInterval/>
                  <telerik:MinuteInterval/>
                  <telerik:SecondInterval/>
              </telerik:RadTimeBar.Intervals>
     
              <Grid>
                  <telerik:RadChart ItemsSource="{Binding DashBoard.SelectedDataItem.SNAPSHOT}" >
                      <telerik:RadChart.DefaultView>
                          <telerik:ChartDefaultView>
                              <telerik:ChartDefaultView.ChartLegend>
                                  <telerik:ChartLegend Visibility="Collapsed"></telerik:ChartLegend>
                              </telerik:ChartDefaultView.ChartLegend>
                              <telerik:ChartDefaultView.ChartArea>
                                  <telerik:ChartArea Margin="0 0 0 0" Padding="0 0 0 0">
                                      <telerik:ChartArea.AxisY>
                                          <telerik:AxisY Visibility="Collapsed" />
                                      </telerik:ChartArea.AxisY>
                                  </telerik:ChartArea>
                              </telerik:ChartDefaultView.ChartArea>
                          </telerik:ChartDefaultView>
                      </telerik:RadChart.DefaultView>
     
                      <telerik:RadChart.SeriesMappings>
                          <telerik:SeriesMapping>
                              <telerik:SeriesMapping.SeriesDefinition>
                                  <telerik:LineSeriesDefinition ShowItemLabels="False" ShowPointMarks="False" />
                              </telerik:SeriesMapping.SeriesDefinition>
                              <telerik:SeriesMapping.ItemMappings>
                                  <!--<telerik:ItemMapping FieldName="DT_TS" DataPointMember="XValue" />-->
                                  <telerik:ItemMapping FieldName="VALORE" DataPointMember="YValue" />
                              </telerik:SeriesMapping.ItemMappings>
                          </telerik:SeriesMapping>
                      </telerik:RadChart.SeriesMappings>
     
                  </telerik:RadChart>
              </Grid>
          </telerik:RadTimeBar>
      </Grid>

    How do I configure the Step in the radchart to coupe with the radtimebar? if I enable the <!--<telerik:ItemMapping FieldName="DT_TS" DataPointMember="XValue" />--> I got no point dragged... I've also seen that the video on telerik tv about radtimebar and radchart does'nt work.....can you please verify?
    Thanks
  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 11 Jun 2012 Link to this post

    Hi Paolo,

    Your code looks correct. That is why, I suppose that the automatic range of the x-axis is not the same as the range of the timeBar control. That is why, I would suggest that you set the x-axis range of the chart control manually. I have attached two user controls to this thread. The XAxis archive file demonstrates the integration of the two controls with AutoRange=true and the AutoRange archive file shows how you can set the x-axis range manually.

    All the best,
    Tsvetie
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top