Welcome to MSDN Blogs Sign in | Join | Help

Silverlight Charting remains just a click away - and runs on WPF, too!! [ChartBuilder sample and source code updated for Charting's March 09 release]

In yesterday's announcement of the March 09 release of the Silverlight Toolkit and Silverlight Charting, I gave an overview of some new Charting features. One of the things I always do right after we release a new version of Charting is update my ChartBuilder sample/application/learning tool. If you're not already familiar with ChartBuilder, here's some background reading: Introduction/user's guide for November 08 release, Fix for non-US cultures, Update for December 08 release.

This time around is no different and I've just updated the live ChartBuilder application! It's a typical Silverlight 2 application, so you can run it with Silverlight 2 OR the newly released Silverlight 3 Beta.

 

Please click this text or the image below to run the latest ChartBuilder in your browser.

ChartBuilder on Silverlight

You can click here to download the complete ChartBuilder source code.

 

Release notes:

  • Added support for new series type AreaSeries.
  • Slightly better round-tripping behavior for doubles and DateTimes from the helper class Pair.
  • Various other minor improvements.
  • Updated the version to 2009-03-20.

 

Although we have - literally - thousands of automated test cases for Charting, ChartBuilder remains our de facto testing tool and has helped us to prevent or debug countless issues during the months we've been developing the Charting framework. I use it regularly to investigate strange behavior or to provide the scaffolding for one-off test cases that would otherwise require quite a bit of time and effort to create.

ChartBuilder won't win any awards for great user interface design, but it has been worth its weight in gold to us. I hope it helps you, too!

 

 

Oh, and one more thing... :)

It's always been our goal with Charting to support both Silverlight and WPF - and we've been compiling Charting for the WPF platform as part of our daily builds for the past few months. I thought it would be neat to show off a sneak preview of WPF Charting here, so I created a WPF build of ChartBuilder and hooked it up to the WPF build of Charting and - yup - it just worked. Well, mostly... :)

Warning: We have done absolutely no testing of the WPF Charting bits and if you decide to pull them out of the source code download and play around with them, then you do so at your own risk!

The great thing about what's going on here is that Silverlight Charting and WPF Charting are both compiled from exactly the same source code and XAML and allow you to use exactly the same source code and XAML in your projects. So you'll be able to create a chart on one platform and share it seamlessly with the other platform and you won't have to do any extra work! To help prove my point, ChartBuilder itself is built from exactly the same source code and XAML for both Silverlight and WPF!

 

ChartBuilder on WPF

 

The most obvious problem I've seen from playing around with WPF ChartBuilder for a little is that sometimes dynamically added/removed DataPoints don't play their reveal/show/hide transition properly. Some of the points coming in are obviously present in the chart because there's space reserved for them and their tooltips work properly - but they're not visible. And some of the points going out just don't go away like they're supposed to. My primary suspect here is VSM (the Visual State Manager; a Silverlight concept that's been ported to WPF); WPF Charting uses the WPF Toolkit's preview implementation of VSM and there may be some incompatibilities between that implementation and the one in Silverlight. Charting on WPF also has a few fit-and-finish issues; these are probably easy to fix, but like I said we haven't spent any time working on Charting for WPF.

Important: If you do decide to try WPF Charting, please note that it's necessary to add references to both the DataVisualization assembly and the WPFToolkit assembly or else you'll get a weird error from WPF when we attempt to use VSM and its implementation isn't present.

 

Okay, that's all I've got for now. :) I hope you have fun with Charting - on whatever platform you choose!

Published Friday, March 20, 2009 1:13 AM by Delay

Comments

# Silverlight Charting remains just a click away - and runs on WPF, too!! [ChartBuilder sample and source code updated for Charting's March 09 release] - Delay's Blog

Friday, March 20, 2009 1:00 PM by DotNetShoutout

Thank you for submitting this cool story - Trackback from DotNetShoutout

# re: Silverlight Charting remains just a click away - and runs on WPF, too!! [ChartBuilder sample and source code updated for Charting's March 09 release]

Saturday, March 21, 2009 6:07 PM by abrien

I'm starting to use these chart controls to make some reports at work, and I've stumbled onto a weird bug, where I get a KeyNotFoundException when I attempt to update the Series.ItemsSource property.

I've also noticed I see the same exception in your WPF version of ChartBuilder when you set the 1st series as a PieSeries and drag the number of series left and right.

Any ideas where that comes from? I've worked around this problem in my code by re-creating the PieSeries instead of just updating its ItemsSource, but I wish I had a simpler solution.

# re: Silverlight Charting remains just a click away - and runs on WPF, too!! [ChartBuilder sample and source code updated for Charting's March 09 release]

Sunday, March 22, 2009 3:44 AM by Delay

abrien,

I've been debugging this and I know why the exception happens in WPF Charting. For some reason that I don't understand yet, the DataPoint.State DependencyProperty is not getting updated when it should and so the DataPoints are all in the wrong states and code that assumes certain invariants ends up being wrong and throwing the exception you see. This may sound familiar - I believe it's exactly the same problem I call out in my post about new/old DataPoints not showing/hiding correctly. Okay, so this is good to know and I'll track down what's going wrong on WPF that the State property isn't behaving properly.

So now I've got one very important question for you: In YOUR scenario are you using WPF Charting or Silverlight Charting? If you're using WPF Charting, then we know the problem and I'll sort it out more on Monday and hopefully give you a fix and sorry, but I did warn you that WPF Charting is completely untested. :) HOWEVER, if you're using Silverlight Charting and seeing this problem, then I would very much like to understand your scenario better because I doubt it's the same exact issue and it's seeming like something we've never seen before. (As you probably know, your ChartBuilder scenario works just fine for on Silverlight.)

If you could please get back to me with the answer, I'd very much appreciate it! If it turns out to be a problem with Silverlight Charting, then I'll work with you to try to come up with a simplified demonstration of the problem that I'll be able to run and debug myself.

Thank you very much for reporting this issue!

# re: Silverlight Charting remains just a click away - and runs on WPF, too!! [ChartBuilder sample and source code updated for Charting's March 09 release]

Sunday, March 22, 2009 5:37 PM by Delay

Update: Soon after turning off the computer, I figured out why the DependencyProperty isn't getting updated. I should be able to fix the WPF Charting issue on Monday and will post a new DLL.

So the big remaining question is whether anyone is seeing this behavior with Silverlight Charting...

# re: Silverlight Charting remains just a click away - and runs on WPF, too!! [ChartBuilder sample and source code updated for Charting's March 09 release]

Monday, March 23, 2009 8:08 PM by Delay

FYI, I have just fixed the issue and will blog more on this shortly. Thanks for your patience!

# Supporting the unsupported [Two fixes for the unofficial WPF Charting assembly!]

Wednesday, March 25, 2009 2:27 PM by Delay's Blog

In my last post I described a few updates I made to my ChartBuilder sample/application/learning tool

# Actualizaciones para el WPF Toolkit y WPF Futures Codeplex.

Thursday, March 26, 2009 10:20 AM by Blog de andygon - Microsoft PM

El WPF Toolkit es una colección de componentes y características de WPF que complementan el .NET Framework.

# WPF Toolkit March 2009 Update is posted

Thursday, March 26, 2009 12:37 PM by Windows Presentation Foundation SDK

Here’s the official word from the WPF Tree Services & Controls Team: We shipped some great new updates

# If they can build it, they will come... [Enabling anyone to compile WPF Charting from the Silverlight Charting sources!]

Thursday, March 26, 2009 4:03 PM by Delay's Blog

In yesterday's post I updated the unsupported public build of WPF Charting . The WPF version of the System.Windows.Controls.DataVisualization.Toolkit.dll

# Windows Presentation Foundation SDK

Thursday, March 26, 2009 5:58 PM by MVP Factor

Esto esta súper bueno, que lo disfruten aqui el detalle: “We shipped some great new updates to the WPF

# WPF stuff and multi touch

Friday, March 27, 2009 8:21 AM by IHateSpaghetti {code}

  Are you intrigued by multi touch? The Windows Engineering team just posted a great article on

# Windows Presentation Foundation SDK

Saturday, March 28, 2009 1:09 PM by Miguel Almeyda

Esto esta excelente, pruébenlo: “We shipped some great new updates to the WPF Toolkit and WPF Futures

# Apparition de contrôles "Chart" gratuits pour WPF et Silverlight

Monday, March 30, 2009 5:38 AM by Elise's blog

L'équipe de Samantha Durante a profité de la realease de Mars des WPF Toolkit pour présenter les nouveaux

# Custom Bar Charts with the Silverlight Toolkit

Thursday, April 09, 2009 6:58 PM by POKE 53280,0: Pete Brown's Blog

[ Note: this was written using Silverlight 3 Beta and the Silverlight 3 version of the Silverlight Toolkit

# Pineapple upside-down chart [How to: Invert the axis of a chart for "smaller is better" scenarios]

Tuesday, May 12, 2009 2:31 PM by Delay's Blog

Let's imagine that we want to use Silverlight (or WPF!) to chart the performance of a book on one of

# Silverlight: Product Maintenance Application ( Part 4 – Adding some controls )

Sunday, June 14, 2009 7:19 AM by Mike Taulty's Blog

Following up on this post I thought the first control I’d build would be a graph control so I just referenced

# Silverlight: Product Maintenance Application ( Part 6 – Porting to WPF )

Sunday, June 14, 2009 7:39 AM by Mike Taulty's Blog

Following on from this post . As expected, porting my Utilities library to WPF wasn’t too difficult.

Anonymous comments are disabled
 
Page view tracker