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 http://www.datasushi.net/Chart.jpg
). 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.