The Area Object (SAArea)
The Area object represents the appearance of a chart area. ExcelWriter includes the following area
objects:
Area Methods and Properties
Area Methods and Properties
|
AreaFormattingSets or retrieves the type of formatting applied to an Area object.
The three types of formatting and their codes are,
| saxlsCreationAutomatic | 0 |
| saxlsCreationNone | 1 |
| saxlsCreationCustom | 2 |
When AreaFormatting is set to saxlsCreationAutomatic (0), the default formatting settings will be applied to
the Area object. SaxlsCreationCustom (2) enables custom formatting assigned to the Area object (colors or pattern).
SaxlsCreationNone will remove all Area formatting (default or custom).
Signature:
[VBScript]
Property AreaFormatting As ASXCreationType (read/write)
The following sets the ChartArea's AreaFormatting to saxlsCreationNone, disabling all ChartArea formatting.
Example:
[VBScript]
'--- Create an instance of ExcelWriter and
'--- create a new column chart
Dim XlwApp, WrkSht, MyChart
Set XlwApp = Server.CreateObject("SoftArtisans.ExcelWriter")
Set WrkSht = XlwApp.Worksheets(1)
Set MyChart = WrkSht.Charts.Add(saxlsColumnChart,0,2,2,10,20)
'--- The IChartFrame.Area property returns an SAArea object
'--- Remove chart area formatting by setting saxlsCreationNone
MyChart.CharArea.Area.AreaFormatting = saxlsCreationNone
Top |
BackgroundColorSets or retrieves the background color of an Area object
(Series Area,
MarkerFormat,
Wall3D, or
ChartFrame Area).
Signature:
[VBScript]
Property BackgroundColor As Integer (read/write)
Example:
[VBScript]
'--- Create an instance of ExcelWriter and create
'--- a new column chart
Dim XlwApp, WrkSht, MyChart
Set XlwApp = Server.CreateObject("SoftArtisans.ExcelWriter")
Set WrkSht = XlwApp.Worksheets(1)
Set MyChart = WrkSht.Charts.Add(saxlsColumnChart,0,2,2,10,20)
'--- Use an SAArea object to set the background
'--- color of a chart
MyChart.CharArea.Area.BackgroundColor = RGB(255,123,100)
Top |
ForegroundColor
Sets or retrieves the foreground color of an Area object
(Series Area,
MarkerFormat,
Wall3D, or
ChartFrame Area). Use
RGB values to assign colors.
Signature:
[VBScript]
Property ForegroundColor As Integer (read/write)
Example:
[VBScript]
'--- Create an instance of ExcelWriter and
'--- create a new column chart
Dim XlwApp, WrkSht, MyChart
Set XlwApp = Server.CreateObject("SoftArtisans.ExcelWriter")
Set WrkSht = XlwApp.Worksheets(1)
Set MyChart = WrkSht.Charts.Add(saxlsColumnChart,0,2,2,10,20)
'--- Use an SAArea object to set the foreground
'--- color of a chart
MyChart.CharArea.Area.ForegroundColor = RGB(255,123,100)
Top |
Pattern
Sets or retrieves the background pattern of an Area object
(Series Area,
MarkerFormat,
Wall3D, or
ChartFrame Area).
Signature:
[VBScript]
Property Pattern As SAXAreaPatternType (read/write)
ExcelWriter
supports nineteen patterns, listed in the table below.
| No Pattern | 0 |
| 0% Pattern | 1 |
| 50% Pattern | 2 |
| 70% Pattern | 3 |
| 25% Pattern | 4 |
| Dark Horizontal | 5 |
| Dark Vertical | 6 |
| Dashed Downward Diagonal | 7 |
| Dashed Upward Diagonal | 8 |
| Small Checkerboard | 9 |
| Trellis | 10 |
| Light Horizontal | 11 |
| Light Vertical | 12 |
| Wide Downward diagonal | 13 |
| Dark Upward diagonal | 14 |
| Small Grid | 15 |
| 60% Pattern | 16 |
| 20% Pattern | 17 |
| 10% Pattern | 18 |
Example:
[VBScript]
'--- Create an instance of ExcelWriter and
'--- create a new column chart
Dim XlwApp, WrkSht, MyChart
Set XlwApp = Server.CreateObject("SoftArtisans.ExcelWriter")
Set WrkSht = XlwApp.Worksheets(1)
Set MyChart = WrkSht.Charts.Add(saxlsColumnChart,0,2,2,10,20)
'--- Set the pattern for an SAArea object to 50%
MyChart.CharArea.Area.Pattern = 2
Top |

Copyright 2006 © SoftArtisans, Inc. All Rights Reserved.
|