Chart for WinRT > Chart Features > Multiple Plot Areas > Plot Area Size |
The PlotArea size can be specified using the ColumnDefinitions and RowDefinitions collections in the class PlotAreaCollection. The approach is similar to working with the standard grid control. The first collection contains column attributes(widths). The second collection is for the row(height). By default, the plot areas have the same width and the same height.
You can use the following code to change the size of the PlotArea:
C# |
Copy Code
|
---|---|
// widths // the width of first plot area is default(fill available space) chart.View.PlotAreas.ColumnDefinitions.Add(new PlotAreaColumnDefinition()); // the width of second plot area is constant 100 px chart.View.PlotAreas.ColumnDefinitions.Add(new PlotAreaColumnDefinition() { Width= new GridLength(100) }); // heights // the height of first plot area is 1* chart.View.PlotAreas.RowDefinitions.Add(new PlotAreaRowDefinition() { Height = new GridLength(1, GridUnitType.Star) }); // the height of second plot area is 2* chart.View.PlotAreas.RowDefinitions.Add(new PlotAreaRowDefinition() { Height = new GridLength(2, GridUnitType.Star) }); |
Using the code above, your chart should resemble the following image: