Class Line
Namespace: Aspose.Cells.Drawing
Assembly: Aspose.Cells.dll (25.2.0)
Encapsulates the object that represents the line format.
public class Line
Inheritance
Derived
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Examples
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
Cells cells = sheet.Cells;
cells[0,1].PutValue("Income");
cells[1,0].PutValue("Company A");
cells[2,0].PutValue("Company B");
cells[3,0].PutValue("Company C");
cells[1,1].PutValue(10000);
cells[2,1].PutValue(20000);
cells[3,1].PutValue(30000);
int chartIndex = sheet.Charts.Add(ChartType.Line, 9, 9, 21, 15);
Chart chart = sheet.Charts[chartIndex];
//Add series
chart.NSeries.Add("A2:B4", true);
//Set category data
chart.NSeries.CategoryData = "=Sheet1!$A$2:$A$4";
//Applying a dotted line style on the lines of an NSeries
chart.NSeries[0].Border.Style = LineType.Dot;
chart.NSeries[0].Border.Color = Color.Red;
//Applying a triangular marker style on the data markers of an NSeries
chart.NSeries[0].Marker.MarkerStyle = ChartMarkerType.Triangle;
//Setting the weight of all lines in an NSeries to medium
chart.NSeries[0].Border.Weight = WeightType.MediumLine;
Dim workbook as Workbook = new Workbook()
Dim sheet as Worksheet = workbook.Worksheets(0)
Dim cells as Cells = sheet.Cells
cells(0,1).PutValue("Income")
cells(1,0).PutValue("Company A")
cells(2,0).PutValue("Company B")
cells(3,0).PutValue("Company C")
cells(1,1).PutValue(10000)
cells(2,1).PutValue(20000)
cells(3,1).PutValue(30000)
Dim chartIndex as Integer = sheet.Charts.Add(ChartType.Column, 9, 9, 21, 15) ///
Dim chart as Chart = sheet.Charts(chartIndex)
'Adding NSeries (chart data source) to the chart ranging from "A2" cell to "B4"
chart.NSeries.Add("A2:B4", True)
'Setting the data source for the category data of NSeries
Chart.NSeries.CategoryData = "A2:A4"
'Applying a dotted line style on the lines of an NSeries
chart.NSeries(0).Border.Style = LineType.Dot
chart.NSeries(0).Border.Color = Color.Red
'Applying a triangular marker style on the data markers of an NSeries
chart.NSeries(0).Marker.MarkerStyle = ChartMarkerType.Triangle
'Setting the weight of all lines in an NSeries to medium
chart.NSeries(0).Border.Weight = WeightType.MediumLine
Fields
m_lineParent
protected object m_lineParent
Field Value
Properties
BeginArrowLength
Specifies the length of the arrowhead for the begin of a line.
public MsoArrowheadLength BeginArrowLength { get; set; }
Property Value
BeginArrowWidth
Specifies the width of the arrowhead for the begin of a line.
public MsoArrowheadWidth BeginArrowWidth { get; set; }
Property Value
BeginType
Specifies an arrowhead for the begin of a line.
public MsoArrowheadStyle BeginType { get; set; }
Property Value
CapType
Specifies the ending caps.
public LineCapType CapType { get; set; }
Property Value
Color
Represents the System.Drawing.Color of the line.
public Color Color { get; set; }
Property Value
CompoundType
Specifies the compound line type
public MsoLineStyle CompoundType { get; set; }
Property Value
DashType
Specifies the dash line type
public MsoLineDashStyle DashType { get; set; }
Property Value
EndArrowLength
Specifies the length of the arrowhead for the end of a line.
public MsoArrowheadLength EndArrowLength { get; set; }
Property Value
EndArrowWidth
Specifies the width of the arrowhead for the end of a line.
public MsoArrowheadWidth EndArrowWidth { get; set; }
Property Value
EndType
Specifies an arrowhead for the end of a line.
public MsoArrowheadStyle EndType { get; set; }
Property Value
FormattingType
Gets or sets format type.
public ChartLineFormattingType FormattingType { get; set; }
Property Value
GradientFill
Represents gradient fill.
public GradientFill GradientFill { get; }
Property Value
IsAuto
Indicates whether this line style is auto assigned.
public bool IsAuto { get; set; }
Property Value
IsAutomaticColor
Indicates whether the color of line is automatic assigned.
public bool IsAutomaticColor { get; }
Property Value
IsVisible
Represents whether the line is visible.
public bool IsVisible { get; set; }
Property Value
JoinType
Specifies the joining caps.
public LineJoinType JoinType { get; set; }
Property Value
Style
Represents the style of the line.
public LineType Style { get; set; }
Property Value
ThemeColor
Gets and sets the theme color.
public ThemeColor ThemeColor { get; set; }
Property Value
Remarks
If the foreground color is not a theme color, NULL will be returned.
Transparency
Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
public double Transparency { get; set; }
Property Value
Weight
Gets or sets the Aspose.Cells.Drawing.WeightType of the line.
public WeightType Weight { get; set; }
Property Value
WeightPt
Gets or sets the weight of the line in unit of points.
public double WeightPt { get; set; }
Property Value
WeightPx
Gets or sets the weight of the line in unit of pixels.
public double WeightPx { get; set; }