This is a migrated thread and some comments may be shown as answers.

RadTimeBar & RadChart XAxis

1 Answer 152 Views
TimeBar
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 05 Jun 2012, 04:11 PM
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

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 11 Jun 2012, 11:50 AM
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 >>

Tags
TimeBar
Asked by
Michele
Top achievements
Rank 2
Answers by
Tsvetie
Telerik team
Share this question
or