WPF Elements: Polar Charts 101

In WPF Elements, our suite of stunning controls for WPF, we have a whole range of different chart controls (In fact, they’re also in Silverlight Elements and Phone Elements!). One of the chart types that we provide are the polar charts. For those who don’t know, polar charts plot their data around a circular axis. Data points are made up of a ‘theta’ value that specifies the angle around the circular axis, and a ‘rho’ value which determines the distance from the data point to the center of the chart.

Here are some of the polar charts you can create with WPF Elements:

Polar series

Here is how to add a polar chart to your application and populate it with data.

First make sure you add a reference to the Mindscape.WpfElements.dll to your project and include the xml namespace in the xaml of your application like this:

xmlns:ms="http://namespaces.mindscape.co.nz/wpf"

Next, you can add a PolarChart to the application and give it a series that will be used to render the data. An example of this is shown below:

<ms:PolarChart Margin="20">
   <ms:RadarSeries ItemsSource="{Binding}" />
</ms:PolarChart>

The PolarChart control manages the title, legend and axes. The RadarSeries is used to render the data in a particular way – that is, all the adjacent data points are connected with a line and the area enclosed within the data points are filled with a brush. WPF Elements comes with all sorts of polar series which render data in their own unique way. PolarScatterSeries simply displays a symbol at each data point. PolarLineSeries connects adjacent data points together with line segments and provides an option for the line to be closed in a loop or left open. RoseSeries is the polar equivalent of a cartesian bar series. There are also spline and stacked polar series available as well. You can add any combination of multiple polar series to a single PolarChart control, each of which manages its own items source.

The example above is binding the ItemsSource to the data context of the window which is a list of data. WPF Elements comes with the PolarPoint class which is the easiest way to populate a polar series with data. Simply specify the theta and rho values for each data point, and the series will know how to plot it on the charting area. You can also create your own data point model class and set the ThetaBinding and RhoBinding properties of the series to tell it which properties of your model objects to plot against which axis. Using WPF templating you can customize the look of your polar charts to change the colors of the series, provide custom data point symbols, template the title, axis, lagend and much more.

Download this simple demo to help get started with adding polar charts to your application. You’ll also want to grab the free 60 day trial of WPF Elements.

If you have any question or feature requests about polar charts or any of our other chart controls, then we’d love to hear from you in the forum.

Tagged as WPF Elements

Leave a Reply

Archives

Join our mailer

You should join our newsletter! Sent monthly:

Back to Top