From 98f1f67d2991726790b1db3a6566647676aab3d2 Mon Sep 17 00:00:00 2001 From: kasmine <736929286@qq.com> Date: Fri, 23 Oct 2020 14:42:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(point-shape):=20=E4=BF=AE=E5=A4=8D=20point?= =?UTF-8?q?=20=E7=9A=84=20shape=20=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit point geometry 通道需要指定 shapeField,不直接使用 seriesField line plot 默认将 seriesField 作为 shapeField,作为 shape 回调参数使用,但是默认 shape 为 circle --- src/adaptor/geometries/point.ts | 4 ++-- src/plots/line/adaptor.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/adaptor/geometries/point.ts b/src/adaptor/geometries/point.ts index 3be874cd08..3acd9c0d33 100644 --- a/src/adaptor/geometries/point.ts +++ b/src/adaptor/geometries/point.ts @@ -23,14 +23,14 @@ export interface PointGeometryOptions extends GeometryOptions { */ export function point(params: Params): Params { const { options } = params; - const { point, seriesField } = options; + const { point, seriesField, shapeField } = options; return point ? geometry( deepMix({}, params, { options: { colorField: seriesField, - shapeField: seriesField, + shapeField: shapeField, type: 'point', mapping: point, }, diff --git a/src/plots/line/adaptor.ts b/src/plots/line/adaptor.ts index 755fcd5902..fef75edeac 100644 --- a/src/plots/line/adaptor.ts +++ b/src/plots/line/adaptor.ts @@ -13,13 +13,14 @@ import { LineOptions } from './types'; */ function geometry(params: Params): Params { const { chart, options } = params; - const { data, color, lineStyle, point: pointMapping } = options; + const { data, color, lineStyle, point: pointMapping, seriesField } = options; chart.data(data); // line geometry 处理 const p = deepMix({}, params, { options: { + shapeField: seriesField, line: { color, style: lineStyle, @@ -28,6 +29,7 @@ function geometry(params: Params): Params { // 如果存在,才设置,否则为空 point: pointMapping && { color, + shape: 'circle', ...pointMapping, }, },