Class Walls

Walls class

Encapsulates the object that represents the walls of a 3-D chart.

public class Walls : Floor

Properties

NameDescription
BackgroundColor { get; set; }Gets or sets the background Color of the Area.(Inherited from Area.)
Border { get; set; }Gets or sets the border Line.(Inherited from Floor.)
CenterX { get; }Gets the x coordinate of the left-bottom corner of Wall center in units of 1/4000 of chart’s width after calls Chart.Calculate() method.
CenterXPx { get; }Gets the x coordinate of the left-bottom corner of Wall center in units of pixels after calls Chart.Calculate() method.
CenterY { get; }Gets the y coordinate of the left-bottom corner of Wall center in units of 1/4000 of chart’s height after calls Chart.Calculate() method.
CenterYPx { get; }Gets the y coordinate of the left-bottom corner of Wall center in units of pixels after calls Chart.Calculate() method.
Depth { get; }Gets the depth front to back in units of 1/4000 of chart’s width after calls Chart.Calculate() method.
DepthPx { get; }Gets the depth front to back in units of pixels after calls Chart.Calculate() method.
FillFormat { get; }Represents a FillFormat object that contains fill formatting properties for the specified chart or shape.(Inherited from Area.)
ForegroundColor { get; set; }Gets or sets the foreground Color.(Inherited from Area.)
Formatting { get; set; }Represents the formatting of the area.(Inherited from Area.)
Height { get; }Gets the height of top to bottom in units of 1/4000 of chart’s height after calls Chart.Calculate() method.
HeightPx { get; }Gets the height of top to bottom in units of pixels after calls Chart.Calculate() method.
InvertIfNegative { get; set; }If the property is true and the value of chart point is a negative number, the foreground color and background color will be exchanged.(Inherited from Area.)
Transparency { get; set; }Returns or sets the degree of transparency of the area as a value from 0.0 (opaque) through 1.0 (clear).(Inherited from Area.)
Width { get; }Gets the width of left to right in units of 1/4000 of chart’s width after calls Chart.Calculate() method.
WidthPx { get; }Gets the width of left to right in units of pixels after calls Chart.Calculate() method.

Methods

NameDescription
GetCubePointCount()Gets the number of cube points after calls Chart.Calculate() method.
GetCubePointXPx(int)Gets x-coordinate of the apex point of walls cube after calls Chart.Calculate() method. The number of apex points of walls cube is eight
GetCubePointYPx(int)Gets y-coordinate of the apex point of walls cube after calls Chart.Calculate() method. The number of apex points of walls cube is eight.

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using Aspose.Cells.Charts;
    using Aspose.Cells.Drawing;
    using System;
    using System.Drawing;

    public class WallsDemo
    {
        public static void WallsExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            // Add sample data for the chart
            worksheet.Cells["A1"].PutValue("Category");
            worksheet.Cells["A2"].PutValue("A");
            worksheet.Cells["A3"].PutValue("B");
            worksheet.Cells["A4"].PutValue("C");
            worksheet.Cells["B1"].PutValue("Value");
            worksheet.Cells["B2"].PutValue(10);
            worksheet.Cells["B3"].PutValue(20);
            worksheet.Cells["B4"].PutValue(30);

            // Add a 3D chart to the worksheet
            int chartIndex = worksheet.Charts.Add(ChartType.Column3D, 5, 0, 15, 5);
            Chart chart = worksheet.Charts[chartIndex];
            chart.NSeries.Add("B2:B4", true);
            chart.NSeries.CategoryData = "A2:A4";

            // Calculate the chart to update its properties
            chart.Calculate();

            // Access the walls of the 3D chart
            Walls walls = chart.Walls;

            // Set properties of the walls
            walls.BackgroundColor = Color.LightBlue;
            walls.ForegroundColor = Color.DarkBlue;
            walls.Formatting = FormattingType.Custom;
            walls.InvertIfNegative = true;
            walls.Transparency = 0.5;

            // Access the border of the walls and set its properties
            Line border = walls.Border;
            border.Color = Color.Red;
            border.Style = LineType.Solid;

            // Print some properties of the walls
            Console.WriteLine("CenterX: " + walls.CenterX);
            Console.WriteLine("CenterY: " + walls.CenterY);
            Console.WriteLine("Width: " + walls.Width);
            Console.WriteLine("Depth: " + walls.Depth);
            Console.WriteLine("Height: " + walls.Height);
            Console.WriteLine("CenterXPx: " + walls.CenterXPx);
            Console.WriteLine("CenterYPx: " + walls.CenterYPx);
            Console.WriteLine("WidthPx: " + walls.WidthPx);
            Console.WriteLine("DepthPx: " + walls.DepthPx);
            Console.WriteLine("HeightPx: " + walls.HeightPx);

            // Save the workbook
            workbook.Save("WallsExample.xlsx");
        }
    }
}

See Also