PlotArea.Y
PlotArea.Y property
Gets or gets the y coordinate of the upper top corner of plot-area bounding box in units of 1/4000 of the chart area.
[Obsolete("Use PlotArea.YRatioToChart property, instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public override int Y { get; set; }
Remarks
The plot-area bounding box includes the plot area, tick marks(tick labels), and a small border around the tick marks. If the value is not created by MS Excel, please call Chart.Calculate() method before calling this method.
The X, Y, Width and Height of PlotArea represents the plot-area bounding box that includes the plot area, tick marks(tick labels), and a small border around the tick marks. If you want to get actual size of plot area, you should call InnerXRatioToChart, InnerYRatioToChart, InnerWidthRatioToChart and InnerHeightRatioToChart properties.
For excel 2007 or latter, the default value is zero. you should call get the value after calling Chart.Calculate().
NOTE: This member is now obsolete. Please use PlotArea.YRatioToChart property, instead. Y = YRatioToChart * 4000. This property will be removed 12 months later since February 2025. Aspose apologizes for any inconvenience you may have experienced.
Examples
using System;
using Aspose.Cells;
using Aspose.Cells.Charts;
namespace AsposeCellsExamples
{
public class PlotAreaPropertyYDemo
{
public static void Run()
{
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
// Sample data
sheet.Cells["A1"].PutValue("Category 1");
sheet.Cells["A2"].PutValue("Category 2");
sheet.Cells["B1"].PutValue(100);
sheet.Cells["B2"].PutValue(50);
// Create chart
int chartIndex = sheet.Charts.Add(ChartType.Column, 5, 5, 20, 10);
Chart chart = sheet.Charts[chartIndex];
// Set chart data
chart.NSeries.Add("B1:B2", false);
chart.NSeries.CategoryData = "A1:A2";
// Configure plot area
chart.PlotArea.Width = 300;
chart.PlotArea.Height = 200;
chart.PlotArea.X = 100;
chart.PlotArea.Y = 150; // Demonstrating Y property usage
// Save the workbook
workbook.Save("PlotAreaPropertyYDemo.xlsx");
}
}
}
See Also
- class PlotArea
- namespace Aspose.Cells.Charts
- assembly Aspose.Cells