Create Interactive Charts with WPF and PowerShell

So I’m not a big Twitter fan, but I do admit – as an IT professional you can find a lot of useful and pertinent information there. One example was this morning when I happened to notice a tweet from Microsoft about their opensource projects on Github. After a quick perusal, I happened across an interesting project called Interactive Data Display for WPF. According to its description:

Interactive Data Display for WPF is a set of controls for adding interactive visualization of dynamic data to your application. It allows to create line graphs, bubble charts, heat maps and other complex 2D plots which are very common in scientific software. Interactive Data Display for WPF integrates well with Bing Maps control to show data on a geographic map in latitude/longitude coordinates. The controls can also be operated programmatically.

There are some nice-looking chart examples there such as:

sinline

markers

barchart (1)

Since there are no native charting controls in WPF this was of interest, so I fired up my PowerShell ISE and tried to get this working.

I created the following simple example using a bar chart. You can change the X or Y values then click Plot to update the chart.

Chart

The nice thing with this control is that it’s interactive – you can scroll the mouse wheel to zoom in and out, as well as move the axis left and right, and double-click to re-center.

barchartinteractive

Here’s the POSH code for the example:

There are a number of dependency libraries that the script will download for you, or you can also install them via the NuGet gallery as indicated in the project’s readme.

This is just a quick demo, but it’s a pretty cool control!

Advertisements

3 thoughts on “Create Interactive Charts with WPF and PowerShell

  1. Receiving the following error:

    Exception calling “Load” with “1” argument(s): “Cannot create unknown type ‘{clr-namespace:InteractiveDataDisplay.WPF;assembly=InteractiveDataDisplay.WPF}Chart’.”

    I’m not familiar with loading assemblies from here strings so not sure what to check. i did verify that allow of the library files existed at the correct paths.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s