From da311cca2fdbb8ed2e08f17d9e567c81be063ca7 Mon Sep 17 00:00:00 2001 From: hustcc Date: Wed, 21 Oct 2020 15:37:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(1758):=20=E9=9D=A2=E7=A7=AF=E5=9B=BE=20line?= =?UTF-8?q?.color=20=E8=AE=BE=E7=BD=AE=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#1759)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __tests__/bugs/issue-1758-spec.ts | 21 +++++++++++++++++++++ src/plots/tiny-area/index.ts | 4 +--- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 __tests__/bugs/issue-1758-spec.ts diff --git a/__tests__/bugs/issue-1758-spec.ts b/__tests__/bugs/issue-1758-spec.ts new file mode 100644 index 0000000000..80d8304799 --- /dev/null +++ b/__tests__/bugs/issue-1758-spec.ts @@ -0,0 +1,21 @@ +import { TinyArea } from '../../src'; +import { createDiv } from '../utils/dom'; + +describe('#1758', () => { + it('area line.color', () => { + const tinyArea = new TinyArea(createDiv('mini 面积图 color 配置不生效'), { + height: 60, + width: 300, + autoFit: false, + data: new Array(100).fill(0).map(() => Math.random() * 100), + smooth: true, + line: { + color: 'red', + }, + }); + + tinyArea.render(); + + expect(tinyArea.chart.geometries[1].elements[0].container.getChildByIndex(0).attr('stroke')).toBe('red'); + }); +}); diff --git a/src/plots/tiny-area/index.ts b/src/plots/tiny-area/index.ts index 939220b889..0578bb6f28 100644 --- a/src/plots/tiny-area/index.ts +++ b/src/plots/tiny-area/index.ts @@ -23,9 +23,7 @@ export class TinyArea extends Plot { }, line: { size: 1, - style: { - stroke: '#5B8FF9', - }, + color: '#5B8FF9', }, }; }