From f16eadb698600b9fd5800053ffcf016faf08691e Mon Sep 17 00:00:00 2001 From: CoolSummer <147201214@qq.com> Date: Tue, 3 Mar 2020 23:08:42 +0800 Subject: [PATCH] feat(bar): in polar axis provide negative values. close #12109 --- src/layout/barPolar.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/layout/barPolar.js b/src/layout/barPolar.js index 2aebd930b0..1266d530bc 100644 --- a/src/layout/barPolar.js +++ b/src/layout/barPolar.js @@ -82,10 +82,17 @@ function barLayoutPolar(seriesType, ecModel, api) { var clampLayout = baseAxis.dim !== 'radius' || !seriesModel.get('roundCap', true); - var valueAxisStart = valueAxis.getExtent()[0]; - + var valueAxisStart; + if(valueAxis.model.option.min){ + valueAxisStart = valueAxis.model.option.min; + }else{ + valueAxisStart = valueAxis.getExtent()[0]; + } for (var idx = 0, len = data.count(); idx < len; idx++) { var value = data.get(valueDim, idx); + if(seriesModel.seriesIndex !== 0){ + value += valueAxisStart; + } var baseValue = data.get(baseDim, idx); var sign = value >= 0 ? 'p' : 'n';