RadLinearSparkline & Timebar + annotations?

6 posts, 0 answers
  1. Paolo
    Paolo avatar
    423 posts
    Member since:
    Jun 2009

    Posted 22 Nov 2012 Link to this post

    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
  2. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 26 Nov 2012 Link to this post

    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.

  3. DevCraft banner
  4. Paolo
    Paolo avatar
    423 posts
    Member since:
    Jun 2009

    Posted 27 Nov 2012 Link to this post

    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
  5. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 29 Nov 2012 Link to this post

    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.

  6. Henry
    Henry avatar
    20 posts
    Member since:
    Aug 2013

    Posted 23 Apr 2014 in reply to Petar Kirov Link to this post

    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
  7. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 28 Apr 2014 Link to this post

    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.
     
Back to Top
DevCraft banner