瀏覽代碼

feat: allow setting lineType for yMarker

pull/347/head
Shivam Mishra 4 年之前
committed by GitHub
父節點
當前提交
d8984ec5ae
共有 2 個檔案被更改,包括 2 行新增1 行删除
  1. +1
    -1
      src/js/objects/ChartComponents.js
  2. +1
    -0
      src/js/utils/draw.js

+ 1
- 1
src/js/objects/ChartComponents.js 查看文件

@@ -187,7 +187,7 @@ let componentConfigs = {
makeElements(data) {
return data.map(m =>
yMarker(m.position, m.label, this.constants.width,
{ labelPos: m.options.labelPos, stroke: m.options.stroke, mode: 'span', lineType: 'dashed' })
{ labelPos: m.options.labelPos, stroke: m.options.stroke, mode: 'span', lineType: m.options.lineType })
);
},
animateElements(newData) {


+ 1
- 0
src/js/utils/draw.js 查看文件

@@ -433,6 +433,7 @@ export function yMarker(y, label, width, options = {}) {
if (!isValidNumber(y)) y = 0;

if (!options.labelPos) options.labelPos = 'right';
if (!options.lineType) options.lineType = 'dashed';
let x = options.labelPos === 'left' ? LABEL_MARGIN
: width - getStringWidth(label, 5) - LABEL_MARGIN;



Loading…
取消
儲存