Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ChartObject.PlotArea Property

Provides access to the chart’s plot area.

Namespace: DevExpress.Spreadsheet.Charts

Assembly: DevExpress.Spreadsheet.v24.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

#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