fix:修复单指标图表组件数据渲染的问题

main
liu.shiyi 1 year ago
parent be90c11142
commit 671ad6d848

@ -90,7 +90,7 @@ const dataHandler = '// 取返回数据列表的第一项指标值\noption.perce
// 图表配置 new Gauge('domName', option)
const option = {
// 数据将要放入到哪个字段中
dataKey: 'data',
dataKey: 'percent',
// 图表内边距
appendPadding: [0, 0, 0, 0],
data,

@ -176,7 +176,7 @@ const dataHandler = '// 取返回数据列表的第一项指标值\noption.perce
// 图表配置 new Liquid('domName', option)
const option = {
// 数据将要放入到哪个字段中
dataKey: 'data',
dataKey: 'percent',
// 图表内边距
appendPadding: [0, 0, 0, 0],
data,

@ -173,6 +173,8 @@ const dataHandler = '// 取返回数据列表的第一项指标值\noption.perce
// 图表配置 new Liquid('domName', option)
const option = {
// 数据将要放入到哪个字段中
dataKey: 'percent',
renderer: 'canvas',
// 图表内边距
appendPadding: [0, 0, 0, 0],

@ -9,7 +9,9 @@ export function saveScreen(data) {
data.chartList.forEach((item) => {
if (item.type == 'customComponent') {
const a = JSON.parse(item.option)
a[a.dataKey] = []
if (a.data) {
a.data = []
}
item.option=JSON.stringify(a)
item.setting=item.setting.map((x) => {
const {field,value,...obj}=x

@ -258,7 +258,7 @@ export default {
config = this.dataFormatting(config, _res)
if (this.chart) {
// 单指标组件和多指标组件的changeData传参不同
if (['Liquid', 'Gauge', 'RingProgress'].includes(config.chartType)) {
if (['Liquid', 'Gauge', 'RingProgress', 'Progress'].includes(config.chartType)) {
this.chart.changeData(config.option.percent)
} else {
this.chart.changeData(config.option.data)

Loading…
Cancel
Save