Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

ChartObject.PlotArea Property

Provides access to the chart’s plot area.

Namespace: DevExpress.Spreadsheet.Charts

Assembly: DevExpress.Spreadsheet.v23.1.Core.dll

Declaration

PlotArea PlotArea { get; }

Property Value

Type Description
PlotArea

A PlotArea object that is the chart’s plot area.

Remarks

The example below demonstrates how to create a transparent chart with a semi-transparent plot area.

View Example

Worksheet worksheet = workbook.Worksheets["chartTask4"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Create a chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.Line, worksheet["B3:D8"]);
chart.TopLeftCell = worksheet.Cells["F3"];
chart.BottomRightCell = worksheet.Cells["L14"];

// Customize the chart area and the plot area appearance.
chart.Fill.SetNoFill();
chart.Outline.SetSolidFill(Color.FromArgb(0x99, 0x99, 0x99));
chart.PlotArea.Fill.SetSolidFill(Color.FromArgb(0x22, 0x99, 0x99, 0x99));

// Specify the position of the legend.
chart.Legend.Position = LegendPosition.Top;

// Use a secondary axis.
chart.Series[1].AxisGroup = AxisGroup.Secondary;

// Customize the axis scale and appearance.
Axis axis = chart.PrimaryAxes[0];
axis.Outline.SetNoFill();
axis.MajorTickMarks = AxisTickMarks.None;

axis = chart.PrimaryAxes[1];
axis.Outline.SetNoFill();
axis.MajorTickMarks = AxisTickMarks.None;
axis.MajorGridlines.Visible = false;
axis.Scaling.AutoMax = false;
axis.Scaling.AutoMin = false;
axis.Scaling.Max = 1400;
axis.Scaling.Min = 0;

axis = chart.SecondaryAxes[1];
axis.Outline.SetNoFill();
axis.MajorTickMarks = AxisTickMarks.None;
axis.Scaling.AutoMax = false;
axis.Scaling.AutoMin = false;
axis.Scaling.Max = 390;
axis.Scaling.Min = 270;
See Also