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

RadLinearSparkline & Timebar + annotations?

5 Answers 47 Views
Sparkline
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 22 Nov 2012, 11:33 AM
Hello,
I was having detail iussue on large adta with timebar & radchart... using RadLinearSparkLines I achieve a better deep detail.
I wish to know if it's possible to add 2 horizontal lines for a limit and a warning as I was doing with annotations in radchart.


Thanks

5 Answers, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 26 Nov 2012, 05:18 PM
Hi Paolo,

The RadSparkline does not support annotations like the RadChart or RadCharView do. However you can use its NormalRange feature - a horizontal stripe defined by the  NormalRangeTop and NormalRangeBottom properties. 

In order to have multiple horizontal lines, you can place multiple sparklines behind the one you want to annotate. Note that you will need to manually set its range, in order to sync the ranges of the sparklines. Here is an example:  
<telerik:RadLinearSparkline x:Name="sparkline1"
                   XValuePath="X" YValuePath="Y"
                   Panel.ZIndex="1"
                             
                   AutoRange="False"
                   MinXValue="0"
                   MaxXValue="10"
                             
                   MinYValue="0"
                   MaxYValue="100"/>
          
<telerik:RadLinearSparkline x:Name="refSparkLine"
                   XValuePath="X" YValuePath="Y"
                   Panel.ZIndex="0"
                             
                   AutoRange="False"                                  
               MinXValue="{Binding ElementName=sparkline1, Path=MinXValue}"
               MaxXValue="{Binding ElementName=sparkline1, Path=MaxXValue}"
                             
               MinYValue="{Binding ElementName=sparkline1, Path=MinYValue}"
               MaxYValue="{Binding ElementName=sparkline1, Path=MaxYValue}"    
                             
                 ShowNormalRange="True"
                 NormalRangeFill="Blue" NormalRangeTop="30"                                        NormalRangeBottom="29"/>

Another thing you will need to do is to set a fake ItemSource to the reference Sparklines. This is needed because if the sparkline does not contain any items, it will not display its NormalRange stripe:
this.refSparkLine.ItemsSource = new List<PlotInfo>()
{
    new PlotInfo { X = -2000, Y = -5000 },
};

I hope this helps.

Greetings,
Petar Kirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Michele
Top achievements
Rank 2
answered on 27 Nov 2012, 07:29 AM
Hello,
when I try to put 2 RadLinearSparkline inside a RadTimeBar I got an error saying content is just defined...what control should I wrap in it? StackPanel? Grid?
Thanks
0
Petar Kirov
Telerik team
answered on 29 Nov 2012, 04:23 PM
Hi Paolo,

RadTimeBar inherits from ContentControl, so you need to provide it with a single element.  You can place all the Sparklines in a grid and place the grid itself in RadTimeBar.
 
Best regards,
Petar Kirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Henry
Top achievements
Rank 1
answered on 24 Apr 2014, 02:46 AM
Hi Petar -- I too would really like to see Annotation for the RadTimeBar.  Is this something that will be available in the future?  You show a demo above, however, are there any other ways to achieve better annotation for a RadTimeBar?
Thanks,
HH
0
Martin Ivanov
Telerik team
answered on 28 Apr 2014, 03:48 PM
Hi Henry,

At this moment we don't have plans to introduce annotations for the RadTimeBar. If you need one you can use the approach described by Petar.

Regards,
Martin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Sparkline
Asked by
Michele
Top achievements
Rank 2
Answers by
Petar Kirov
Telerik team
Michele
Top achievements
Rank 2
Henry
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or