Description
AChartsheet
object represents a worksheet that contains only a chart.
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.
Property or method is not valid on Chartsheets, and will throw an InvalidOperationException
Property or method is fully supported on Chartsheets
Property behaves as an autoproperty, but will have no effect on the resulting file.
Property | Valid on Chartsheet | Notes |
---|---|---|
Returns a Cells object, but using any methods or properties on the object will throw an InvalidOperationException. | ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
Returns an empty enumeration | ||
Returns a ChartPageSetup object | ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
Returns SheetViewState.Normal. Setting it to a different value with throw an InvalidOperationException. | ||
| ||
Defaults to 120% |
Method | Valid on Chartsheet | Notes |
---|---|---|
| ||
| ||
| ||
The row and column properties will be ignored. The offset properties should specify a percentage of the entire chartsheet. | ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|
Examples