Line

Line class

封装表示行格式的对象。

public class Line

特性

姓名描述
BeginArrowLength { get; set; }指定行首的箭头长度。
BeginArrowWidth { get; set; }指定行首箭头的宽度。
BeginType { get; set; }指定行首的箭头。
CapType { get; set; }指定结尾大写。
Color { get; set; }代表Color行的.
CompoundType { get; set; }指定复合线型
DashType { get; set; }指定虚线类型
EndArrowLength { get; set; }指定行尾的箭头长度。
EndArrowWidth { get; set; }指定行尾的箭头宽度。
EndType { get; set; }指定行尾的箭头。
FormattingType { get; set; }获取或设置格式类型。
GradientFill { get; }表示渐变填充。
IsAuto { get; set; }指示此线型是否自动分配。
IsAutomaticColor { get; }表示线的颜色是否自动分配。
IsVisible { get; set; }表示线是否可见。
JoinType { get; set; }指定连接大写字母。
Style { get; set; }代表线条的样式。
ThemeColor { get; set; }获取和设置主题颜色。
Transparency { get; set; }将线条的透明度返回或设置为从 0.0(不透明)到 1.0(透明)的值。
Weight { get; set; }获取或设置WeightType行的.
WeightPt { get; set; }获取或设置线的权重,以点为单位。
WeightPx { get; set; }获取或设置线条的权重,以像素为单位。

例子


[C#]

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];
//在 NSeries 的线条上应用虚线样式
chart.NSeries[0].Border.Style = LineType.Dot;
chart.NSeries[0].Border.Color = Color.Red;
//在 NSeries 的数据标记上应用三角形标记样式
chart.NSeries[0].Marker.MarkerStyle = ChartMarkerType.Triangle;
//将NSeries中所有行的权重设置为medium
chart.NSeries[0].Border.Weight = WeightType.MediumLine;

[Visual Basic]

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)
'在 NSeries 的线上应用虚线样式
chart.NSeries(0).Border.Style = LineType.Dot
chart.NSeries(0).Border.Color = Color.Red
'在 NSeries 的数据标记上应用三角形标记样式
chart.NSeries(0).Marker.MarkerStyle = ChartMarkerType.Triangle
'将 NSeries 中所有行的粗细设置为 medium
chart.NSeries(0).Border.Weight = WeightType.MediumLine

也可以看看