Is There a Way to Do This?

2 posts, 0 answers
  1. Aaron
    Aaron avatar
    38 posts
    Member since:
    Apr 2008

    Posted 01 Nov 2010 Link to this post

    I need to render a line chart, in order to show tempurature trends over time, at one or more locations.

    I want to use the Silverlight RadChart control to do this, because I want the user to be able to zoom in and srutinize the data, to zoom back out and pan around etc.  I'm pretty sure the ASP.NET version of the control doesn't offer these capabilities, so I believe that Silverlight is my only option if I want to offer zoom and scroll features in a web app. Is that more or less acurate? 

    So, I'm at a loss because my data comes as a collection of TempuratureMeasurement objects, which have an ID, a siteID, to indicate which location the meter was located at, a DateTime, to record the date of the measurement (they're taken once a day), and the tempurature measurement itself, in degrees Farenheight (don't ask me why).

    So I'd been rendering the chart programmatically, because I can't figure out a way to render a discreet series for each disticnt location.  The data comes looking something like this:

    ID    SiteID    Date                            Tempurature
     1    1            1/26/2010 12:30 PM    65.6
     2    1            1/27/2010 12:30 PM    67.1
     3    1            1/28/2010 12:30 PM    51.0
     4    2            1/26/2010 12:30 PM    66.7
     5    2            1/27/2010 12:30 PM    79.2
     6    2            1/28/2010 12:30 PM    55.9

    And I want to have a chart that looks something like the attached (also viewable at  This is of course a vast over-simplification.  Basically: 2 lines, one for each distinct site. 

    So I've been rendering this programmatically, because as I said, I couldn't figure out how to get it to render the way I needed it using databinding.  But I've learned that RadChart for Silverlight's zoom and scroll features aren't supported in programmatically rendered chart scenarios, just in data-binding scenarios.

    So now I'm once again trying to figure out how to render this chart using data-binding.  If this were RadChart for ASP.NET AJAX, then I could use the DataGroupColumn property of the chart, setting it to "SiteID", which would tell RadChart to look to the SiteID property, and rendering one data series for each distinct value.

    But unforuntately the DataGroupColumn property is not offered in RadChart for Silverlight. I've asked in a separate forum post if there is an equivalent property.

    So is this even possible?  It seems like it would be a fairly common need: to look at trends in data over time, and to be able to zoom in and out on the data. 

    Maybe the shape of my data is what's throwing things off.  Does this data shape seem weird?  It's pretty much straight out of a SQL table.  Maybe I need to pivot the data first, but then, how would I be able to pass it around in WCF?  Or should I pivot the data in Silverlight, then bind it? Are data pivoting tools even available in Silverlight?

    Anyway, please offer any suggestions you can.  Like I said, this seems like it would be a really common requirement.

  2. Nikolay
    Nikolay avatar
    397 posts

    Posted 02 Nov 2010 Link to this post

    Hi Aaron,

    Please, find attached a sample project which utilizes DataBinding and a ChartGroupDescriptor in order to group the data in the manner, in which the attached image does. Perhaps this example would be helpful for you in creating your application.

    You can find more information on grouping and aggregation in the following help topics : Grouping and Aggregation and DateTime Grouping. Our online demo example for grouping may also be useful for you.

    Hope this helps.

    Kind regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top