Line类

Line类

封装表示行格式的对象。

Line 类型公开了以下成员:

特性

属性描述
compound_type指定复合线型
dash_type指定虚线类型
cap_type指定结束大写。
join_type指定连接帽。
begin_type指定行首的箭头。
end_type指定行尾的箭头。
begin_arrow_length指定行首箭头的长度。
end_arrow_length指定行尾箭头的长度。
begin_arrow_width指定行首箭头的宽度。
end_arrow_width指定行尾箭头的宽度。
theme_color获取和设置主题颜色。
color代表线的颜色。
transparency将线条的透明度返回或设置为从 0.0(不透明)到 1.0(透明)的值。
style表示线条的样式。
weight获取或设置线路的 WeightType
weight_pt以点为单位获取或设置线的权重。
weight_px以像素为单位获取或设置线条的粗细。
formatting_type获取或设置格式类型。
is_automatic_color指示线的颜色是否自动分配。
is_visible表示线条是否可见。
is_auto指示此线型是否自动指定。
gradient_fill代表渐变填充。

例子

from aspose.cells import Workbook
from aspose.cells.charts import ChartMarkerType, ChartType
from aspose.cells.drawing import LineType, WeightType
from aspose.pydrawing import Color

workbook = Workbook()
sheet = workbook.worksheets[0]
cells = sheet.cells
cells.get(0, 1).put_value("Income")
cells.get(1, 0).put_value("Company A")
cells.get(2, 0).put_value("Company B")
cells.get(3, 0).put_value("Company C")
cells.get(1, 1).put_value(10000)
cells.get(2, 1).put_value(20000)
cells.get(3, 1).put_value(30000)
chartIndex = sheet.charts.add(ChartType.LINE, 9, 9, 21, 15)
chart = sheet.charts[chartIndex]
# Applying a dotted line style on the lines of an NSeries
chart.n_series[0].border.style = LineType.DOT
chart.n_series[0].border.color = Color.red
# Applying a triangular marker style on the data markers of an NSeries
chart.n_series[0].marker.marker_style = ChartMarkerType.TRIANGLE
# Setting the weight of all lines in an NSeries to medium
chart.n_series[0].border.weight = WeightType.MEDIUM_LINE

也可以看看