This is an automated email from the ASF dual-hosted git repository. shenyi pushed a commit to branch fix-polar-bar-background in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
commit 582cd73a11ea93a42c6117bc4050d4fd11b33882 Author: pissang <[email protected]> AuthorDate: Sun Apr 26 19:43:01 2020 +0800 fix(bar): fix bar background incorrect on polar --- src/chart/bar/BarView.js | 10 ++++++++-- test/bar-background.html | 10 +++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/chart/bar/BarView.js b/src/chart/bar/BarView.js index 747f4ad..e100870 100644 --- a/src/chart/bar/BarView.js +++ b/src/chart/bar/BarView.js @@ -144,7 +144,10 @@ export default echarts.extendChartView({ var bgLayout = getLayout[coord.type](data, dataIndex); var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout); bgEl.useStyle(backgroundModel.getBarItemStyle()); - bgEl.setShape('r', barBorderRadius); + // Only cartesian2d support borderRadius. + if (coord.type === 'cartesian2d') { + bgEl.setShape('r', barBorderRadius); + } bgEls[dataIndex] = bgEl; } @@ -181,7 +184,10 @@ export default echarts.extendChartView({ if (drawBackground) { var bgEl = oldBgEls[oldIndex]; bgEl.useStyle(backgroundModel.getBarItemStyle()); - bgEl.setShape('r', barBorderRadius); + // Only cartesian2d support borderRadius. + if (coord.type === 'cartesian2d') { + bgEl.setShape('r', barBorderRadius); + } bgEls[newIndex] = bgEl; var bgLayout = getLayout[coord.type](data, newIndex); diff --git a/test/bar-background.html b/test/bar-background.html index 1ca94f3..8164f72 100644 --- a/test/bar-background.html +++ b/test/bar-background.html @@ -227,7 +227,7 @@ under the License. var chart = testHelper.create(echarts, 'main1', { option: option, title: [ - 'large mode' + 'Background with large render mode.' ] }); }); @@ -299,7 +299,7 @@ under the License. var chart = testHelper.create(echarts, 'main2', { option: option, title: [ - 'normal bars' + 'Background with normal render mode.' ] }); }); @@ -345,7 +345,7 @@ under the License. var chart = testHelper.create(echarts, 'main3', { option: option, title: [ - 'polar bars' + 'Bar background on radial polar' ] }); }); @@ -392,7 +392,7 @@ under the License. var chart = testHelper.create(echarts, 'main4', { option: option, title: [ - 'polar bars' + 'Bar background on tangential polar' ] }); }); @@ -446,7 +446,7 @@ under the License. var chart = testHelper.create(echarts, 'main5', { option: option, title: [ - 'polar bars' + 'Multiple bar series with background on radial polar' ] }); }); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
