Page tree
Skip to end of metadata
Go to start of metadata

Description

A Chartsheet object represents a worksheet that contains only a chart.
C#
vb.net

Remarks

To create a Chartsheet, use Worksheets.createChartsheet() or Chart.MoveChart(). To get an existing Chartsheet, get a Worksheet using Workbook.Worksheets[i] and check if it is of type Chartsheet.

Anchors behave slightly differently on Chartsheets than on regular worksheets. When creating an anchor, the row and column properties are ignored. The OffsetX and OffsetY properties specify a percentage value, with 0 corresponding to the left or top edge, and 100 corresponding to the bottom or right edge of the Chartsheet. This allows you to add a shape or picture to an arbitrary position on the Chartsheet.

Similarly, the Width and Height properties on Shapes, Pictures, and Groups specify a percentage of the total width or height of the chartsheet. So a Shape with a width of 25 would occupy 25% of the Chartsheet.

You can have as many Shape, Pictures, and Groups as you wish on the chartsheet. However, you may only have one chart on the chartsheet, which is specified with the Chart property.

Some Worksheet properties are not valid on a Chartsheet.

 

The following table summarizes the behavior of Worksheet properties on Chartsheets. If you try to access or set a property on a Chartsheet that is not valid, an InvalidOperationException will be thrown. Some properties will behave as AutoProperties, but will have no effect in the saved file. If the property is supported but there are differences in behavior from Worksheets, the differences are described in the Notes column.

(error) Property or method is not valid on Chartsheets, and will throw an InvalidOperationException
(tick) Property or method is fully supported on Chartsheets
(warning) Property behaves as an autoproperty, but will have no effect on the resulting file.

Property

Valid on Chartsheet

Notes

Cells

(warning)

Returns a Cells object, but using any methods or properties on the object will throw an InvalidOperationException.

Charts

(error)

 

Comments

(error)

 

FirstShownColumn

(warning)

 

FirstShownRow

(warning)

 

FreezePanes

(error)

 

GridlinesColor

(warning)

 

Hyperlinks

(error)

 

IsProtected

(tick)

 

IsSelected

(tick)

 

Name

(tick)

 

NamedRanges

(warning)

Returns an empty enumeration

PageSetup

(tick)

Returns a ChartPageSetup object

Pictures

(tick)

 

PopulatedCells

(error)

 

Position

(tick)

 

ProtectPasswordHash

(tick)

 

ShapeGroups

(tick)

 

Shapes

(tick)

 

ShowFormulas

(warning)

 

ShowGridlines

(warning)

 

ShowRowColHeaders

(warning)

 

ShowZeroValues

(warning)

 

StandardHeight

(error)

 

StandardWidth

(error)

 

StandardWidthInChars

(error)

 

SummaryColumns

(error)

 

SummaryRows

(error)

 

TabColor

(tick)

 

Workbook

(tick)

 

ViewState

(warning)

Returns SheetViewState.Normal. Setting it to a different value with throw an InvalidOperationException.

Visibility

(tick)

 

ZoomPercentage

(tick)

Defaults to 120%

Examples

C#
vb.net

Properties

Name

Description

Chart

Returns a Chart object representing the chart in the chart sheet.
  • No labels