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

Sparkline disappears when changing TimeBars visibleperiod

5 Answers 62 Views
Sparkline
This is a migrated thread and some comments may be shown as answers.
Clas Ericson
Top achievements
Rank 2
Clas Ericson asked on 21 Sep 2012, 09:32 AM
Hello,
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

Sort by
0
Clas Ericson
Top achievements
Rank 2
answered on 24 Sep 2012, 08:45 AM
Hello again,
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
0
Yavor
Telerik team
answered on 25 Sep 2012, 11:18 AM
Hello 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.

Regards,
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.

0
Clas Ericson
Top achievements
Rank 2
answered on 28 Sep 2012, 01:12 PM
Hello,
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
0
Yavor
Telerik team
answered on 03 Oct 2012, 08:42 AM
Hello Clas,

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.

0
Clas Ericson
Top achievements
Rank 2
answered on 09 Oct 2012, 06:52 AM
Hello,
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
Tags
Sparkline
Asked by
Clas Ericson
Top achievements
Rank 2
Answers by
Clas Ericson
Top achievements
Rank 2
Yavor
Telerik team
Share this question
or