Aspose::Cells::Drawing::Line class

Line class

Encapsulates the object that represents the line format.

class Line

Methods

MethodDescription
GetBeginArrowLength()Specifies the length of the arrowhead for the begin of a line.
GetBeginArrowWidth()Specifies the width of the arrowhead for the begin of a line.
GetBeginType()Specifies an arrowhead for the begin of a line.
GetCapType()Specifies the ending caps.
GetColor()Represents the Color of the line.
GetCompoundType()Specifies the compound line type.
GetDashType()Specifies the dash line type.
GetEndArrowLength()Specifies the length of the arrowhead for the end of a line.
GetEndArrowWidth()Specifies the width of the arrowhead for the end of a line.
GetEndType()Specifies an arrowhead for the end of a line.
GetFormattingType()Gets or sets format type.
GetGradientFill()Represents gradient fill.
GetJoinType()Specifies the joining caps.
GetStyle()Represents the style of the line.
GetThemeColor()Gets and sets the theme color.
GetTransparency()Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
GetWeight()Gets or sets the WeightType of the line.
GetWeightPt()Gets or sets the weight of the line in unit of points.
GetWeightPx()Gets or sets the weight of the line in unit of pixels.
IsAuto()Indicates whether this line style is auto assigned.
IsAutomaticColor()Indicates whether the color of line is automatic assigned.
IsNull() constChecks whether the implementation object is nullptr.
IsVisible()Represents whether the line is visible.
Line(Line_Impl* impl)Constructs from an implementation object.
Line(const Line& src)Copy constructor.
explicit operator bool() constoperator bool()
operator=(const Line& src)operator=
SetBeginArrowLength(MsoArrowheadLength value)Specifies the length of the arrowhead for the begin of a line.
SetBeginArrowWidth(MsoArrowheadWidth value)Specifies the width of the arrowhead for the begin of a line.
SetBeginType(MsoArrowheadStyle value)Specifies an arrowhead for the begin of a line.
SetCapType(LineCapType value)Specifies the ending caps.
SetColor(const Aspose::Cells::Color& value)Represents the Color of the line.
SetCompoundType(MsoLineStyle value)Specifies the compound line type.
SetDashType(MsoLineDashStyle value)Specifies the dash line type.
SetEndArrowLength(MsoArrowheadLength value)Specifies the length of the arrowhead for the end of a line.
SetEndArrowWidth(MsoArrowheadWidth value)Specifies the width of the arrowhead for the end of a line.
SetEndType(MsoArrowheadStyle value)Specifies an arrowhead for the end of a line.
SetFormattingType(ChartLineFormattingType value)Gets or sets format type.
SetIsAuto(bool value)Indicates whether this line style is auto assigned.
SetIsVisible(bool value)Represents whether the line is visible.
SetJoinType(LineJoinType value)Specifies the joining caps.
SetStyle(LineType value)Represents the style of the line.
SetThemeColor(const ThemeColor& value)Gets and sets the theme color.
SetTransparency(double value)Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
SetWeight(WeightType value)Gets or sets the WeightType of the line.
SetWeightPt(double value)Gets or sets the weight of the line in unit of points.
SetWeightPx(double value)Gets or sets the weight of the line in unit of pixels.
~Line()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
Workbook workbook;
Worksheet sheet = workbook.GetWorksheets().Get(0);

Cells cells = sheet.GetCells();
cells.Get(0, 1).PutValue(u"Income");
cells.Get(1, 0).PutValue(u"Company A");
cells.Get(2, 0).PutValue(u"Company B");
cells.Get(3, 0).PutValue(u"Company C");
cells.Get(1, 1).PutValue(10000);
cells.Get(2, 1).PutValue(20000);
cells.Get(3, 1).PutValue(30000);

int chartIndex = sheet.GetCharts().Add(ChartType::Line, 9, 9, 21, 15);
Chart chart = sheet.GetCharts().Get(chartIndex);
//Add series
chart.GetNSeries().Add(u"A2:B4", true);
//Set category data
chart.GetNSeries().SetCategoryData(u"=Sheet1!$A$2:$A$4");
//Applying a dotted line style on the lines of an NSeries
chart.GetNSeries().Get(0).GetBorder().SetStyle(LineType::Dot);
chart.GetNSeries().Get(0).GetBorder().SetColor(Color{ 0xff, 0xff, 0, 0 });
//Applying a triangular marker style on the data markers of an NSeries
chart.GetNSeries().Get(0).GetMarker().SetMarkerStyle(ChartMarkerType::Triangle);
//Setting the weight of all lines in an NSeries to medium
chart.GetNSeries().Get(0).GetBorder().SetWeight(WeightType::MediumLine);

Aspose::Cells::Cleanup();

See Also