RadColumnSparkline: Declarative Example ?

5 posts, 1 answers
  1. Guido
    Guido avatar
    3 posts
    Member since:
    Jan 2011

    Posted 11 Mar 2011 Link to this post

    Hi all,
    can you give an example for binding a RadColumnSparkline to data ? I got the RadLinearSparkline working, but the RadColumnSparkline seems to need a different data format.

    Thanks in advance
    Guido

  2. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 16 Mar 2011 Link to this post

    Hi Guido,

    RadColumnSparklines can be configured in the same way as RadLinearSparkline, RadAreaSparkline, etc. Your markup can look like this:

    <telerik:RadLinearSparkline ItemsSource="{Binding Data}" XValuePath="TimeStamp" YValuePath="Value" />
    <telerik:RadColumnSparkline ItemsSource="{Binding Data}" XValuePath="TimeStamp" YValuePath="Value" />
    As you can see except for the name of the control all other attributes are the same.

    Please take e look on this example in our online demos.


    Kind regards,
    Yavor Ivanov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. UI for WPF is Visual Studio 2017 Ready
  4. Guido
    Guido avatar
    3 posts
    Member since:
    Jan 2011

    Posted 16 Mar 2011 Link to this post

    Hi Yavor,
    thank you for your answer. You told me exactly what I'm hoping for. But unfortunately it currently doens't work in my scenario.
    Perhaps you'll see the reason.

    you were referring to Silverlight examples, I'm using WPF. This might not make a difference, but it could be one reason, why it's not working.

    I use exactly the same markup for RadColumn and RadLinearSparkline:

                                
    <telerik:RadColumnSparkline<BR>                                
    x:Name="PART_SparkbarControl"<BR>                                
    telerik:StyleManager.Theme="Office_Blue"<BR>                                
    ShowAxis="False"<BR>                                
    Visibility="Visible"<BR>                                
    ItemsSource="{Binding 
    ActualMeasure}"<BR>                                
    XValuePath="Cost"<BR>                                
    YValuePath="UnitCost"<BR>                                
    HorizontalAlignment="Left"<BR>                                
    Margin="0"<BR>                                
    VerticalAlignment="Top" 
    <BR>                                
    /><BR>                               
    <telerik:RadLinearSparkline<BR>                                
    x:Name="PART_SparklineControl"<BR>                                
    ShowAxis="False"<BR>                                
    Visibility="Visible"<BR>                                
    ItemsSource="{Binding 
    ActualMeasure}"<BR>                                
    XValuePath="Cost"<BR>                                
    YValuePath="UnitCost"<BR>                                
    ShowHighPointIndicators="True"<BR>                                
    ShowLowPointIndicators="True"<BR>                                
    HorizontalAlignment="Left"<BR>                                
    Margin="0"<BR>                                
    VerticalAlignment="Top"<BR>                               
    /><BR>                           

    The LinearSparkline is showing, the The ColumnsSparkline is not.
    What could be the problem ?

    Best regards,
    Guido
  5. Answer
    Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 18 Mar 2011 Link to this post

    Hi Guido,

    I have attached a runnable version of your code that demonstrates how to load your sparklines with sample data. Perhaps the problem could be in the data that you are loading your sparklines with.

    Best wishes,
    Yavor Ivanov
    the Telerik team
  6. Guido
    Guido avatar
    3 posts
    Member since:
    Jan 2011

    Posted 30 Mar 2011 Link to this post

    You are right, both controls can display the same data.
    My misconception was, that I expected spark controls to accept timestamps as x-values (as other chart controls do). But that was where I was wrong.
    Now I bind the X-values to integers and everything works as expected.
    Thanks.
Back to Top
UI for WPF is Visual Studio 2017 Ready