mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 19:42:56 +08:00
Merge pull request #7705 from dataease/pr@dev-v2@fix_liquid_big_number
fix(视图-水波图): 数值过大显示异常
This commit is contained in:
commit
5e73fb07b3
@ -112,6 +112,14 @@ export class Liquid extends G2PlotChartView<LiquidOptions, G2Liquid> {
|
||||
|
||||
protected configLabel(chart: Chart, options: LiquidOptions): LiquidOptions {
|
||||
const customAttr = parseJson(chart.customAttr)
|
||||
const originVal = options.percent
|
||||
// 数值过大视图会异常,大于 1 无意义
|
||||
if (originVal > 1) {
|
||||
options = {
|
||||
...options,
|
||||
percent: 1
|
||||
}
|
||||
}
|
||||
if (!customAttr.label?.show) {
|
||||
return {
|
||||
...options,
|
||||
@ -130,9 +138,8 @@ export class Liquid extends G2PlotChartView<LiquidOptions, G2Liquid> {
|
||||
fontSize: label.fontSize.toString() + 'px',
|
||||
color: label.color
|
||||
},
|
||||
formatter: function (v) {
|
||||
const value = v.percent
|
||||
return valueFormatter(value, labelFormatter)
|
||||
formatter: () => {
|
||||
return valueFormatter(originVal, labelFormatter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user