This question is locked. New answers and comments are not allowed.
I use the time bar to show orders and invoices, but it happens some problems. All data bind from view model. Orders will be added a record which order date is period start if orders have not this. The same as period end. The SelectionStart and SelectionEnd are calculated in view model. Details show in the attached picture.
Best regards
Best regards
PeriodEnd = OptionPeriodEnd;
PeriodStart = OptionPeriodStart;
Criteria.EndDate = PeriodEnd;
SelectionEnd = Criteria.EndDate.Value;
var startDate =
new
DateTime(PeriodEnd.Year, PeriodEnd.Month, 1).AddMonths(-3);
Criteria.StartDate = PeriodStart.CompareTo(startDate) < 0 ? startDate : PeriodStart;
SelectionStart = Criteria.StartDate.Value;
<
telerik:RadTimeBar
x:Name
=
"timeBar"
IsSnapToIntervalEnabled
=
"True"
MinZoomRange
=
"7.00:00:00"
PeriodStart
=
"{Binding PeriodStart, Mode=OneWay}"
PeriodEnd
=
"{Binding PeriodEnd, Mode=OneWay}"
MinSelectionRange
=
"7.00:00:00"
SelectionStart
=
"{Binding SelectionStart, Mode=TwoWay}"
SelectionEnd
=
"{Binding SelectionEnd, Mode=TwoWay}"
BorderThickness
=
"0"
Margin
=
"10,10,10,0"
Grid.Row
=
"1"
Grid.ColumnSpan
=
"2"
MinHeight
=
"100"
MaxHeight
=
"130"
Foreground
=
"{StaticResource text}"
Style
=
"{StaticResource RadTimeBarStyle}"
Opacity
=
"1"
>
<
i:Interaction.Triggers
>
<
i:EventTrigger
EventName
=
"SelectionChanged"
>
<
i:InvokeCommandAction
Command
=
"{Binding ReloadAllCommand}"
/>
</
i:EventTrigger
>
</
i:Interaction.Triggers
>
<
telerik:RadTimeBar.Intervals
>
<
telerik:YearInterval
/>
<
telerik:QuarterInterval
/>
<
telerik:MonthInterval
/>
<
telerik:WeekInterval
/>
</
telerik:RadTimeBar.Intervals
>
<
Grid
>
<
telerik:RadLinearSparkline
x:Name
=
"ActualTrend"
FirstPointBrush
=
"{StaticResource invoice}"
Foreground
=
"{StaticResource text}"
LastPointBrush
=
"{StaticResource invoice}"
MarkersBrush
=
"{x:Null}"
NegativePointBrush
=
"{StaticResource invoice}"
AutoRange
=
"False"
XValuePath
=
"OrderDate"
YValuePath
=
"InvoiceAmount"
LineStroke
=
"{StaticResource invoice}"
ItemsSource
=
"{Binding Orders, Mode=OneWay}"
Visibility
=
"Visible"
/>
<
telerik:RadLinearSparkline
x:Name
=
"TargetTrend"
FirstPointBrush
=
"{StaticResource order}"
Foreground
=
"{StaticResource text}"
LastPointBrush
=
"{StaticResource order}"
MarkersBrush
=
"{x:Null}"
NegativePointBrush
=
"{StaticResource order}"
XValuePath
=
"OrderDate"
YValuePath
=
"OrderAmount"
LineStroke
=
"{StaticResource order}"
ItemsSource
=
"{Binding Orders, Mode=OneWay}"
>
</
telerik:RadLinearSparkline
>
</
Grid
>
</
telerik:RadTimeBar
>