From c6f7462d80ab626174329b69045fb7e5704c0683 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 05 六月 2021 22:44:17 +0800 Subject: [PATCH] 2021-06-05 --- src/menu/components/chart/antv-bar/index.jsx | 37 ++++++++++++++++++++++++++++++++++++- 1 files changed, 36 insertions(+), 1 deletions(-) diff --git a/src/menu/components/chart/antv-bar/index.jsx b/src/menu/components/chart/antv-bar/index.jsx index bea61f9..87789f7 100644 --- a/src/menu/components/chart/antv-bar/index.jsx +++ b/src/menu/components/chart/antv-bar/index.jsx @@ -75,7 +75,7 @@ parentId: card.parentId || '', format: 'array', // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡 pageable: false, // 缁勪欢灞炴�� - 鏄惁鍙垎椤� - switchable: false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� + switchable: card.type === 'bar' ? true : false, // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹� dataName: card.dataName || '', width: _plot.width, name: _plot.name, @@ -348,6 +348,23 @@ .color('key') .size(3) .shape('circle') + } + + if (plot.area === 'true') { + let area = chart.area().shape(plot.shape || 'smooth').position(`${X_axis}*value`).tooltip(false) + if (plot.colors && plot.colors.length > 0) { + let limit = chartColors.length + area.color('key', (key) => { + if (colors.has(key)) { + return colors.get(key) + } else { + colorIndex++ + return chartColors[(colorIndex - 1) % limit] + } + }) + } else { + area.color('key') + } } if (plot.interaction && plot.interaction.length) { @@ -926,6 +943,15 @@ if (plot.barSize || plot.correction) { _chart.size(plot.barSize || 35) } + if (plot.selectColor) { + _chart.state({ + selected: { + style: { + fill: plot.selectColor, + } + } + }) + } if (plot.barRadius) { _chart.style({ radius: [plot.barRadius, plot.barRadius, 0, 0] }) } @@ -975,6 +1001,15 @@ if (plot.barSize || plot.correction) { _chart.size(plot.barSize || 35) } + if (plot.selectColor) { + _chart.state({ + selected: { + style: { + fill: plot.selectColor, + } + } + }) + } if (plot.barRadius) { _chart.style({ radius: [plot.barRadius, plot.barRadius, 0, 0] }) } -- Gitblit v1.8.0