Blogs

Bryan Wood - DevExpress Charts Blog

information and training regarding all things DevExpress Charting.

WPF and Silverlight Charting - Multiple Panes (coming soon in v2011 vol 2)

     

Are you building a financial chart with Silverlight? Do you need to see your volume bars along with your latest set of stock charts? Maybe you want to plot 4 different panes of data each with their own axis and scales. Coming in DXperience 2011 volume 2 you will be able to do that and more with our new support for Multiple Panes in both Silverlight and WPF. Let’s take a look and see what it looks like.

Silverlight-WPF-multiple-panes-chart-bar-line-

In the above image you are seeing 3 separate panes all sharing on common X axis. One of the really cool things about this is that it is all declarative. Meaning you define and assign the panes in XAML, the example below shows you exactly how this is done:

<dxc:XYDiagram2D.PanesPanel>
    <ItemsPanelTemplate>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="2*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="1.7*"/>
            </Grid.RowDefinitions>
        </Grid>
    </ItemsPanelTemplate>
</dxc:XYDiagram2D.PanesPanel>
<dxc:XYDiagram2D.DefaultPane>
    <dxc:Pane x:Name="temperaturePane" Grid.Row="0">
        <dxc:Pane.AxisXScrollBarOptions>
            <dxc:ScrollBarOptions Visible="False" />
        </dxc:Pane.AxisXScrollBarOptions>
    </dxc:Pane>
</dxc:XYDiagram2D.DefaultPane>
<dxc:XYDiagram2D.Panes>
    <dxc:Pane x:Name="pressurePane" Grid.Row="1">
        <dxc:Pane.AxisXScrollBarOptions>
            <dxc:ScrollBarOptions Visible="False" />
        </dxc:Pane.AxisXScrollBarOptions>
    </dxc:Pane>
    <dxc:Pane x:Name="humidityPane" Grid.Row="2"/>
</dxc:XYDiagram2D.Panes>

Something that is interesting about the code above is you can take advantage of the XAML you already know by defining the base layout using a Grid alternately you could also use a StackPanel, Canvas, or UniformGrid. Because we support the standard XAML layout controls this gives you a lot of leeway in defining the panel structure. In addition to the horizontal panes you see here you could easily set up panes vertically as well. Just because you have multiple panes doesn’t mean you are going to loose the ability to have multiple Axes, each pane will still be able to take advantage of both multiple X and Y Axes.

Scrolling and Zooming is also fully supported by each individual pane. As the above code sample shows you can easily add, remove or modify the scroll bars for each individual pane by using the ScrollBarOptions.Visible = False|True. This also gives you the flexibility to use one scroll bar to scroll all panes (as in the above screen shot) or you can have a scroll bar for each pane.

The last thing we need to think about is appearance and you can rest assured that the appearance is completely under your control as well since each pane also has properties that let you adjust the template, background, and scroll bar settings to name a few.

Conclusion

We have a lot of new features coming to you in DXperience 2011 volume 2. Stay tuned here to get the latest announcements and to learn how to better take advantage of your DevExpress Charting Suites. As always if you have any questions or comments please leave them below!

Published Sep 19 2011, 01:46 PM by Bryan Wood (DevExpress)
Filed under: , , ,
Technorati tags: WPF, Charts, Silverlight, v2011.2
Bookmark and Share

Comments

 

rdawg said:

This is a great feature.  You may want to fix the labels in the first pane, because some of the labels are getting cut-off.

September 19, 2011 10:40 PM
 

Alan (DevExpress) said:

@rdawg: Thank you for your comment!

As for labels, we have already fixed this problem in our internal builds, and now the Y-axis range is auto-corrected so that all labels are completely visible on a pane.

September 20, 2011 8:40 AM
 

rdawg said:

Sweet!

September 20, 2011 11:40 AM
 

Scott Grosch said:

If we had custom X and Y axis, why would we want to use a pane vs. just having two seperate charts?

March 14, 2012 11:37 AM
 

Alan (DevExpress) said:

Hi Scott,

Panes are usually useful when you have one axis common for all series (e.g., axis of arguments). If you have totally different X and Y axes for all your series, it seems that the use of different charts would be the best solution in your case.

March 15, 2012 4:46 AM
 

Dizzy Singh said:

im trying to find examples how how you'd be able to have the panes and series dynamically created based on your data or by using data templates.  for example lets say i had a model called Chart, which contains a collection of Panes (Chart.ChartPanes), and further more each Pane contains collection of Series data to plot (ChartPane.ChartSeriesCollection).  

What i'd like to see happen is for each ChartPane, a pane is created, and for each series within that ChartPane, a series is drawn/plotted within that pane based on some attribute (i.e. Line, Bar, etc).

Is something like this possible using just XAML and a ViewModel?

April 1, 2012 10:46 PM
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.