Show code in...     

  

 

Object Model ExcelApplication Worksheets Worksheet Cells Cell Range
Charts Chart SeriesCollection Series 3DProperties Axis ChartFrame Line Area
PivotField PivotFields PivotTable PivotTables
Style Characters Font Pictures Picture DocumentProperties PageSetup


The Line Object (SALine)

The Line object represents the appearance a chart line. ExcelWriter includes the following line objects:

Line Methods and Properties

Line Methods and Properties
LineColor

Sets or retrieves the color of a Line object (AxisLine, MajorGridline, MinorGridline, Wall3DBorder, Series Border, or ChartFrame Border).


[VBScript]
Property LineColor As Long (read/write)

	

Example:



[VBScript]

'--- Create an instance of ExcelWriter and add a column chart to worksheet #1
Dim XlwApp, WrkSht, MyChart, MySeries
Set XlwApp = Server.CreateObject("SoftArtisans.ExcelWriter")
Set WrkSht = XlwApp.Worksheets(1)
Set MyChart = WrkSht.Charts.Add(saxlsColumnChart, 0, 1, 1, 10, 10)

'--- Add a series to the chart's series collection
Set MySeries = MyChart.SeriesCollection("A1:B10",, 0)

'--- Use the SALine object to format the series border
MySeries.Border.LineColor = RGB(255,0,0)
MySeries.Border.LineStyle = saxlsDash
MySeries.Border.LineFormatting = saxlsCreationCustom
MySeries.Border.LineWeight = saxlsMediumLine


Note: To display a series border and its markers in one solid color, set all of the following properties to the desired color:

For example:

objSeries1.Border.LineColor = rgb(255,0,0)
objSeries1.MarkerFormat.BackgroundColor = rgb(255,0,0)
objSeries1.MarkerFormat.ForegroundColor = rgb(255,0,0)
	

Top

LineFormatting

Sets or retrieves the type of formatting applied to an Line object. The three types of formatting and their codes are,

saxlsCreationAutomatic0
saxlsCreationNone1
saxlsCreationCustom2

When LineFormatting is set to saxlsCreationAutomatic (0), the default formatting settings will be applied to the Line object. SaxlsCreationCustom (2) enables custom formatting assigned to the Line object (colors or style). SaxlsCreationNone will remove all Line formatting (default or custom).

The following sets LineFormatting to saxlsCreationNone for the border of the chart area, disabling all formatting.


[VBScript]
Property LineFormatting As ASXCreationType (read/write)

		

Example:



[VBScript]

'--- Create an instance of ExcelWriter and add a column chart to worksheet #1
Dim XlwApp, WrkSht, MyChart, MySeries
Set XlwApp = Server.CreateObject("SoftArtisans.ExcelWriter")
Set WrkSht = XlwApp.Worksheets(1)
Set MyChart = WrkSht.Charts.Add(saxlsColumnChart, 0, 1, 1, 10, 10)

'--- Add a series to the chart's series collection
Set MySeries = MyChart.SeriesCollection("A1:B10",, 0)

'--- Use the SALine object to format the series border
MySeries.Border.LineColor = RGB(255,0,0)
MySeries.Border.LineStyle = saxlsDash
MySeries.Border.LineFormatting = saxlsCreationCustom
MySeries.Border.LineWeight = saxlsMediumLine


Top

LineStyle

Sets or retrieves the style of a Line object (AxisLine, MajorGridline, MinorGridline, Wall3DBorder, Series Border, or ChartFrame Border). ExcelWriter supports nine line styles:

Solid0
Dash1
Dot2
Dash-Dot3
Dash-Dot-Dot4
Dark Gray5
Medium Gray6
Light Gray8

The following sets the style of the minor gridlines on the Y axis to Dash-Dot-Dot.


[VBScript]
Property LineStyle As ASXLineStyle (read/write)

		

Example:



[VBScript]

'--- Create an instance of ExcelWriter and add a column chart to worksheet #1
Dim XlwApp, WrkSht, MyChart, MySeries
Set XlwApp = Server.CreateObject("SoftArtisans.ExcelWriter")
Set WrkSht = XlwApp.Worksheets(1)
Set MyChart = WrkSht.Charts.Add(saxlsColumnChart, 0, 1, 1, 10, 10)

'--- Add a series to the chart's series collection
Set MySeries = MyChart.SeriesCollection("A1:B10",, 0)

'--- Use the SALine object to format the series border
MySeries.Border.LineColor = RGB(255,0,0)
MySeries.Border.LineStyle = saxlsDash
MySeries.Border.LineFormatting = saxlsCreationCustom
MySeries.Border.LineWeight = saxlsMediumLine


Top

LineWeight

Sets or retrieves the weight of a Line object (AxisLine, MajorGridline, MinorGridline, Wall3DBorder, Series Border, or ChartFrame Border). LineWeight has four possible values:

HairLine0
SingleLine1
MediumLine2
WideLine3

The following sets the weight of the major gridlines on the Y axis to WideLine.


[VBScript]
Property LineWeight As ASXLineWeight (read/write)

		

Example:



[VBScript]

'--- Create an instance of ExcelWriter and add a column chart to worksheet #1
Dim XlwApp, WrkSht, MyChart, MySeries
Set XlwApp = Server.CreateObject("SoftArtisans.ExcelWriter")
Set WrkSht = XlwApp.Worksheets(1)
Set MyChart = WrkSht.Charts.Add(saxlsColumnChart, 0, 1, 1, 10, 10)

'--- Add a series to the chart's series collection
Set MySeries = MyChart.SeriesCollection("A1:B10",, 0)

'--- Use the SALine object to format the series border
MySeries.Border.LineColor = RGB(255,0,0)
MySeries.Border.LineStyle = saxlsDash
MySeries.Border.LineFormatting = saxlsCreationCustom
MySeries.Border.LineWeight = saxlsMediumLine


Top



Object Model ExcelApplication Worksheets Worksheet Cells Cell Range
Charts Chart SeriesCollection Series 3DProperties Axis ChartFrame Line Area
PivotField PivotFields PivotTable PivotTables
Style Characters Font Pictures Picture DocumentProperties PageSetup


Copyright © 2005, SoftArtisans, Inc.