WinForms, ASP.NET and WPF Charts: More on Adaptive Chart Layout (Coming soon in v14.2)

DevExpress Data Blog
17 November 2014

I thought I would share a little more detail on the upcoming adaptive chart layout feature coming in our 14.2 release. Previously resizing a chart would produce something like this:

Standard Chart Without Adaptive Layout

While the chart still looks good, the data bars (the essential part of the chart) are being overshadowed by other non-essential elements. The adaptive chart layout feature is designed to help this particular problem.

Enabling Adaptive Layouts

The adaptive chart layout feature is enabled by default and you don't need to write any line of code to implement this functionality in your application. Just make sure the ChartControl.AutoLayout property is set to true.

How does it work?

Inside any chart there are a number of elements that have a Visibility (WinForms, ASP.NET) or Visible (WPF) property (e.g., a legend, an axis, an axis title, a chart title). These elements are systematically hidden as the chart becomes smaller. In addition to those elements, if a BarSeriesLabel.Position property is set to BarSeriesLabelPosition.Auto  we automatically modify the position with respect to the chart size. Take a look:

Chart With Adaptive Layout

In case of pie and donut charts, the Dimension property for SimpleDiagram and SimpleDiagram3D is calculated automatically during resizing. For instance, when you decrease chart size, all pies (donuts) are placed in one line horizontally (by row) or vertically (by column) in the diagram to occupy all of the available free space.

Pie Chart With Adaptive Layout

To disable the adaptive layout feature, set the ChartControl.AutoLayout property to false.

This subtle, but important, feature is another step towards truly intelligent data visualizations that not only look great, but adapt to your customers’ constraints.

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.