[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Drawing.IChart.AddShapeInPixel

AddShapeInPixel Method

AddShapeInPixel(AutoShapeType, double, double, double, double)

Creates an AutoShape in this chart using pixel-based coordinates.

The shape is positioned relative to the upper-left corner of the chart area, and the returned IShape represents the newly created AutoShape.

Declaration
IShape AddShapeInPixel(AutoShapeType type, double left, double top, double width, double height)
Function AddShapeInPixel(type As AutoShapeType, left As Double, top As Double, width As Double, height As Double) As IShape
Parameters
Type Name Description
AutoShapeType type

The type of AutoShape to create.

double left

The distance from the left edge of the AutoShape's boundary box to the left edge of the chart area, in pixels.

double top

The distance from the top edge of the AutoShape's boundary box to the top edge of the chart area, in pixels.

double width

The width of the AutoShape's boundary box, in pixels.

double height

The height of the AutoShape's boundary box, in pixels.

Returns
Type Description
IShape

The IShape object that represents the new AutoShape.

Examples
IChart chart = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 20, 20, 300, 200).Chart;
IShape autoShape = chart.AddShapeInPixel(AutoShapeType.Chevron, 30, 25, 120, 80);
autoShape.Fill.Color.RGB = Color.Blue;
Exceptions
Type Condition
ArgumentException

if type is None.