From 89007be46a88fd2e4ef194a10e02bcb9ddecde79 Mon Sep 17 00:00:00 2001 From: zhaxnb Date: Mon, 15 Jan 2024 10:23:59 +0800 Subject: [PATCH] fix: fix using the toolbox to change line or bar charts but without using default boundaryGap configuration. --- src/component/toolbox/feature/MagicType.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/component/toolbox/feature/MagicType.ts b/src/component/toolbox/feature/MagicType.ts index e13d6db6cd..e9aec1fbfc 100644 --- a/src/component/toolbox/feature/MagicType.ts +++ b/src/component/toolbox/feature/MagicType.ts @@ -116,7 +116,7 @@ class MagicType extends ToolboxFeature { zrUtil.defaults(newSeriesOpt, seriesModel.option); (newOption.series as SeriesOption[]).push(newSeriesOpt); } - // Modify boundaryGap + // Modify series const coordSys = seriesModel.coordinateSystem; if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) { const categoryAxis = coordSys.getAxesByScale('ordinal')[0]; @@ -130,7 +130,6 @@ class MagicType extends ToolboxFeature { for (let i = 0; i <= axisIndex; i++) { (newOption[axisType] as any)[axisIndex] = (newOption[axisType] as any)[axisIndex] || {}; } - (newOption[axisType] as any)[axisIndex].boundaryGap = type === 'bar'; } } };