I've encountered a strange behaviour when using RadLinearSparkline inside a RadTimeBar. The sparkline displays correctly until I change RadTimeBars VisiblePeriodEnd or VisiblePeriodStart. In the beginning the sparkline scales well but somewhere around half visibleperiod the sparkline disapperas but not the high and low points.
See the following link for example: https://dl.dropbox.com/u/435313/sparkline.png
Anyone knows why?
Regards, Clas Ericson
5 Answers, 1 is accepted
I found out that my RadLinearSparkLine disapperas only when one end of the visible period slider passes the middle. The data bound to the sparkline is untouched throughout the whole "slider drag process".
This seems a bit odd to me , maybe a bug? Anyway, below is a code excerpt displaying how I set the radTimebar and RadLinearSparkline in xaml.
<
telerik:RadTimeBar
Grid.Row
=
"2"
Margin
=
"0,5,0,0"
Style
=
"{StaticResource DefaultRadTimeBarStyle}"
PeriodStart
=
"{Binding StatisticsStartDate, Mode=TwoWay}"
PeriodEnd
=
"{Binding StatisticsEndDate, Mode=TwoWay}"
VisiblePeriodStart
=
"{Binding StatisticsStartDate, Mode=TwoWay}"
VisiblePeriodEnd
=
"{Binding StatisticsEndDate, Mode=TwoWay}"
SelectionStart
=
"{Binding SelectedStartDate, Mode=TwoWay}"
SelectionEnd
=
"{Binding SelectedEndDate, Mode=TwoWay}"
MinSelectionRange
=
"28.00:00:00"
MaxSelectionRange
=
"366.00:00:00"
IsSnapToIntervalEnabled
=
"True"
>
<
telerik:RadTimeBar.Intervals
>
<
telerik2:YearInterval
/>
<
telerik2:QuarterInterval
/>
<
telerik2:MonthInterval
/>
</
telerik:RadTimeBar.Intervals
>
<
telerik:RadLinearSparkline
ShowHighPointIndicators
=
"True"
ShowLowPointIndicators
=
"True"
ShowAxis
=
"False"
XValuePath
=
"XDateTimeValue"
YValuePath
=
"YValue"
ItemsSource
=
"{Binding SparkLineData}"
/>
</
telerik:RadTimeBar
>
Thankful for any ideas I can get!
Regards, Clas
From the code you shared I can see that you are binding the PeriodStart / End and VisiblePeriodStart / End to the same properties in your view model. This is short circuit, because every change of the visible period changes the entire period, and can produce very strange results. You can change the Visible period bindings to another properties or remove the binding from the xaml and test if the sparkline is behaving the same way.
I have attached a sample app we used in our lab that clearly shows how the timebar behaves when the period and visible period are bound to the same property.
Yavor
the Telerik team
Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.
thanks for your reply but unfortunately it didn't make any difference in this case. The sparkline still disappears when one of the handles of the VisiblePeriods slider passes middle of the slider controls actualwidth.
Regards, Clas Ericson
In the sample app that I sent to you the sparkline works as expected if I remove the VisiblePeriodStart/ End bindings. Note that initially the timebar shows the whole period, so you don't have to set it explicitly. Can you please try to remove the visible period bindings and tell us how it is?
Regards,Yavor
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
unfortunately it didn't make any difference to remove the bindings to VisiblePeriodStart/End. I'll try to make an "isolated" example solution that behaves like I've explained and post it here.
Kind regards, Clas Ericson