Line

Line class

Encapsulates the object that represents the line format.

class Line;

Example

const { Workbook, ChartType, LineType, ChartMarkerType, WeightType } = AsposeCells;

var workbook = new Workbook();
var cells = workbook.worksheets.get(0).cells;
cells.get("a1").putValue(2);
cells.get("a2").putValue(5);
cells.get("a3").putValue(3);
cells.get("a4").putValue(6);
cells.get("b1").putValue(4);
cells.get("b2").putValue(3);
cells.get("b3").putValue(6);
cells.get("b4").putValue(7);
var chartIndex = workbook.worksheets.get(0).charts.add(ChartType.Column, 11, 0, 27, 10);
var chart = workbook.worksheets.get(0).charts.get(chartIndex);
chart.nSeries.add("A1:B4", true);
//Applying a dotted line style on the lines of an NSeries
chart.nSeries.get(0).border.style = LineType.Dot;
//Applying a triangular marker style on the data markers of an NSeries
chart.nSeries.get(0).marker.markerStyle = ChartMarkerType.Triangle;
//Setting the weight of all lines in an NSeries to medium
chart.nSeries.get(0).border.weight = WeightType.MediumLine;

Properties

PropertyTypeDescription
compoundTypeMsoLineStyleSpecifies the compound line type
dashTypeMsoLineDashStyleSpecifies the dash line type
capTypeLineCapTypeSpecifies the ending caps.
joinTypeLineJoinTypeSpecifies the joining caps.
beginTypeMsoArrowheadStyleSpecifies an arrowhead for the begin of a line.
endTypeMsoArrowheadStyleSpecifies an arrowhead for the end of a line.
beginArrowLengthMsoArrowheadLengthSpecifies the length of the arrowhead for the begin of a line.
endArrowLengthMsoArrowheadLengthSpecifies the length of the arrowhead for the end of a line.
beginArrowWidthMsoArrowheadWidthSpecifies the width of the arrowhead for the begin of a line.
endArrowWidthMsoArrowheadWidthSpecifies the width of the arrowhead for the end of a line.
themeColorThemeColorGets and sets the theme color.
colorColorRepresents the Color of the line.
transparencynumberReturns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
styleLineTypeRepresents the style of the line.
weightWeightTypeGets or sets the WeightType of the line.
weightPtnumberGets or sets the weight of the line in unit of points.
weightPxnumberGets or sets the weight of the line in unit of pixels.
formattingTypeChartLineFormattingTypeGets or sets format type.
isAutomaticColorbooleanReadonly. Indicates whether the color of line is automatic assigned.
isVisiblebooleanRepresents whether the line is visible.
isAutobooleanIndicates whether this line style is auto assigned.
gradientFillGradientFillReadonly. Represents gradient fill.

compoundType

Specifies the compound line type

compoundType : MsoLineStyle;

dashType

Specifies the dash line type

dashType : MsoLineDashStyle;

capType

Specifies the ending caps.

capType : LineCapType;

joinType

Specifies the joining caps.

joinType : LineJoinType;

beginType

Specifies an arrowhead for the begin of a line.

beginType : MsoArrowheadStyle;

endType

Specifies an arrowhead for the end of a line.

endType : MsoArrowheadStyle;

beginArrowLength

Specifies the length of the arrowhead for the begin of a line.

beginArrowLength : MsoArrowheadLength;

endArrowLength

Specifies the length of the arrowhead for the end of a line.

endArrowLength : MsoArrowheadLength;

beginArrowWidth

Specifies the width of the arrowhead for the begin of a line.

beginArrowWidth : MsoArrowheadWidth;

endArrowWidth

Specifies the width of the arrowhead for the end of a line.

endArrowWidth : MsoArrowheadWidth;

themeColor

Gets and sets the theme color.

themeColor : ThemeColor;

Remarks

If the foreground color is not a theme color, NULL will be returned.

color

Represents the Color of the line.

color : Color;

transparency

Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).

transparency : number;

style

Represents the style of the line.

style : LineType;

weight

Gets or sets the WeightType of the line.

weight : WeightType;

weightPt

Gets or sets the weight of the line in unit of points.

weightPt : number;

weightPx

Gets or sets the weight of the line in unit of pixels.

weightPx : number;

formattingType

Gets or sets format type.

formattingType : ChartLineFormattingType;

isAutomaticColor

Readonly. Indicates whether the color of line is automatic assigned.

isAutomaticColor : boolean;

isVisible

Represents whether the line is visible.

isVisible : boolean;

isAuto

Indicates whether this line style is auto assigned.

isAuto : boolean;

gradientFill

Readonly. Represents gradient fill.

gradientFill : GradientFill;