Skip to content

Element Line

xlf-summer edited this page Feb 9, 2020 · 2 revisions

line 元素用于绘制实线或虚线

new Painter(canvasContext).draw({
  /** 元素(锚点)的垂直位置 */
  top: 10,  
  /** 元素(锚点)的水平位置 */
  left: 30,
  /** 绘制直线元素 */
  type: "line",
  /** 直线的颜色 */
  color: "#000",
  /** 直线在水平方向上的跨度 */
  dx: 45,
  /** 直线在垂直方向上的跨度 */
  dy: 10,
  /** 直线的宽度 */
  lineWidth: 2,
  /** 虚线的模式 */
  dashPattern: [1, 0]
});

示例

Clone this wiki locally