Hi
I have this XamTimeline
<ig:XamTimeline x:Name="MyTimeLine" Grid.Row="1"> <ig:XamTimeline.Axis> <ig:DateTimeAxis Minimum="01/01/10" AutoRange="False" Maximum="01/30/10" ShowLabels="True" ShowMajorTickMarks="True" ShowMinorTickMarks="True" UnitType="Hours" ShowThumb="True"> </ig:DateTimeAxis> </ig:XamTimeline.Axis> </ig:XamTimeline>
I want it to display both date AND time based on the zoom resolution but it seems that the "resolution" is calculated based on the DateTimeAxis range therefore it displays date OR time
Thx
Hello,
I have taken the liberty of registering you in our system and creating a Feature Request on your behalf. I have sent your feature request directly to our product management team. Our product team chooses new feature requests for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products so as trends appear in requested features, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your feature is chosen for development you will be notified at that time. Your reference number for this feature request is FR13013.
Than for the feedback.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
Hi,
Unfortunately, there isn’t an automatic way to do this, but it seems like a good feature for the future releases.
Thanks for your fast reply but what I need is different
I need to "adapt" the UnitType and Unit by the XamTimeLine.DateTimeAxis VisibleMinimum and VisibleMaximum. Something like that:
or
so the user will see both the days and the hours, and not like the default that display hours without indication of days
So is there a way to do it automatically through XAML or do i need to in the code : void Zoombar_ZoomChanged(object sender, Infragistics.Controls.ZoomChangedEventArgs e) { TimeSpan diff = (((DateTimeAxis)MyTimeLine.Axis).VisibleMaximum - ((DateTimeAxis)MyTimeLine.Axis).VisibleMinimum); SetResolution(diff); } private void SetResolution(TimeSpan diff) { DateTimeAxis axis = MyTimeLine.Axis as DateTimeAxis; if (axis == null) return; _monthSeries.Entries.Clear(); _daySeries.Entries.Clear(); if (diff.Hours < 24) { axis.UnitType = DateTimeUnitType.Minutes; axis.Unit = 1; } if (diff.Days < 4) { axis.UnitType = DateTimeUnitType.Hours; axis.Unit = 1; var days = GetDays(axis.VisibleMinimum , axis.VisibleMaximum); SetDaysSeries(days); } else if (diff.Days > 4 && diff.Days < 30) { axis.UnitType = DateTimeUnitType.Days; axis.Unit = 1; } else { axis.UnitType = DateTimeUnitType.Months; axis.Unit = 1; var months = GetMonths(axis.VisibleMinimum , axis.VisibleMaximum); SetMonthSeries(months); } }
So is there a way to do it automatically through XAML or do i need to in the code :
You can format the date time labels with:
<Style x:Key="labelStyle" TargetType="ig:AxisLabel">
<Setter Property="StringFormat" Value="{}{0:f}" />
</Style>
…
<ig:XamTimeline.Axis>
<ig:DateTimeAxis Minimum="01/01/2012"
Maximum="04/01/2013"
LabelStyle="{StaticResource labelStyle}"
AutoRange="False"
Unit="1"/>
</ig:XamTimeline.Axis>
More info you can find:
http://help.infragistics.com/NetAdvantage/DV/2010.3/CLR4.0/?page=SL_DV_xamWebTimeline_Format_DateTime_Values.html