public class Line
extends java.lang.Object
Example
Workbook workbook = new Workbook();
Worksheet sheet = workbook.getWorksheets().get(0);
Cells cells = sheet.getCells();
cells.get(0,1).putValue("Income");
cells.get(1,0).putValue("Company A");
cells.get(2,0).putValue("Company B");
cells.get(3,0).putValue("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("A2:B4", true);
//Set category data
chart.getNSeries().setCategoryData("=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.getRed());
//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.MEDIUM_LINE);
| Modifier and Type | Method and Description |
|---|---|
int |
getBeginArrowLength()
Specifies the length of the arrowhead for the begin of a line.
|
int |
getBeginArrowWidth()
Specifies the width of the arrowhead for the begin of a line.
|
int |
getBeginType()
Specifies an arrowhead for the begin of a line.
|
int |
getCapType()
Specifies the ending caps.
|
Color |
getColor()
Represents the
Color of the line. |
int |
getCompoundType()
Specifies the compound line type
|
int |
getDashType()
Specifies the dash line type
|
int |
getEndArrowLength()
Specifies the length of the arrowhead for the end of a line.
|
int |
getEndArrowWidth()
Specifies the width of the arrowhead for the end of a line.
|
int |
getEndType()
Specifies an arrowhead for the end of a line.
|
int |
getFormattingType()
Gets format type.
|
GradientFill |
getGradientFill()
Represents gradient fill.
|
int |
getJoinType()
Specifies the joining caps.
|
int |
getStyle()
Represents the style of the line.
|
ThemeColor |
getThemeColor()
Gets the theme color.
|
double |
getTransparency()
Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
|
int |
getWeight()
Gets the
WeightType of the line. |
double |
getWeightPt()
Gets the weight of the line in unit of points.
|
double |
getWeightPx()
Gets the weight of the line in unit of pixels.
|
boolean |
isAuto()
Indicates whether this line style is auto assigned.
|
boolean |
isAutomaticColor()
Indicates whether the color of line is automatic assigned.
|
boolean |
isVisible()
Represents whether the line is visible.
|
void |
setAuto(boolean value)
Indicates whether this line style is auto assigned.
|
void |
setBeginArrowLength(int value)
Specifies the length of the arrowhead for the begin of a line.
|
void |
setBeginArrowWidth(int value)
Specifies the width of the arrowhead for the begin of a line.
|
void |
setBeginType(int value)
Specifies an arrowhead for the begin of a line.
|
void |
setCapType(int value)
Specifies the ending caps.
|
void |
setColor(Color value)
Represents the
Color of the line. |
void |
setCompoundType(int value)
Specifies the compound line type
|
void |
setDashType(int value)
Specifies the dash line type
|
void |
setEndArrowLength(int value)
Specifies the length of the arrowhead for the end of a line.
|
void |
setEndArrowWidth(int value)
Specifies the width of the arrowhead for the end of a line.
|
void |
setEndType(int value)
Specifies an arrowhead for the end of a line.
|
void |
setFormattingType(int value)
Sets format type.
|
void |
setJoinType(int value)
Specifies the joining caps.
|
void |
setStyle(int value)
Represents the style of the line.
|
void |
setThemeColor(ThemeColor value)
Sets the theme color.
|
void |
setTransparency(double value)
Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
|
void |
setVisible(boolean value)
Represents whether the line is visible.
|
void |
setWeight(int value)
Sets the
WeightType of the line. |
void |
setWeightPt(double value)
Sets the weight of the line in unit of points.
|
void |
setWeightPx(double value)
Sets the weight of the line in unit of pixels.
|
public int getCompoundType()
See MsoLineStyle.
public void setCompoundType(int value)
See MsoLineStyle.
public int getDashType()
See MsoLineDashStyle.
public void setDashType(int value)
See MsoLineDashStyle.
public int getCapType()
See LineCapType.
public void setCapType(int value)
See LineCapType.
public int getJoinType()
See LineJoinType.
public void setJoinType(int value)
See LineJoinType.
public int getBeginType()
See MsoArrowheadStyle.
public void setBeginType(int value)
See MsoArrowheadStyle.
public int getEndType()
See MsoArrowheadStyle.
public void setEndType(int value)
See MsoArrowheadStyle.
public int getBeginArrowLength()
See MsoArrowheadLength.
public void setBeginArrowLength(int value)
See MsoArrowheadLength.
public int getEndArrowLength()
See MsoArrowheadLength.
public void setEndArrowLength(int value)
See MsoArrowheadLength.
public int getBeginArrowWidth()
See MsoArrowheadWidth.
public void setBeginArrowWidth(int value)
See MsoArrowheadWidth.
public int getEndArrowWidth()
See MsoArrowheadWidth.
public void setEndArrowWidth(int value)
See MsoArrowheadWidth.
public ThemeColor getThemeColor()
Remarks
If the foreground color is not a theme color, NULL will be returned.public void setThemeColor(ThemeColor value)
Remarks
If the foreground color is not a theme color, NULL will be returned.public double getTransparency()
public void setTransparency(double value)
public int getStyle()
See LineType.
public void setStyle(int value)
See LineType.
public int getWeight()
WeightType of the line.
See WeightType.
public void setWeight(int value)
WeightType of the line.
See WeightType.
public double getWeightPt()
public void setWeightPt(double value)
public double getWeightPx()
public void setWeightPx(double value)
public int getFormattingType()
public void setFormattingType(int value)
public boolean isAutomaticColor()
public boolean isVisible()
public void setVisible(boolean value)
public boolean isAuto()
public void setAuto(boolean value)
public GradientFill getGradientFill()
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.