update dist and lib

This commit is contained in:
jiaming743
2020-06-16 14:34:36 +08:00
parent f581aee5c3
commit a2875684ce
4 changed files with 79 additions and 56 deletions

View File

@ -67,6 +67,11 @@ export default {
fontSize: 30,
fill: '#3de7c9'
},
/**
* @description Number formatter
* @type {Null|Function}
*/
formatter: undefined,
/**
* @description CRender animationCurve
* @type {String}
@ -130,7 +135,7 @@ export default {
})
},
getShape () {
const { number, content, toFixed, textAlign, rowGap } = this.mergedConfig
const { number, content, toFixed, textAlign, rowGap, formatter } = this.mergedConfig
const [w, h] = this.renderer.area
@ -144,7 +149,8 @@ export default {
content,
toFixed,
position,
rowGap
rowGap,
formatter
}
},
getStyle () {

View File

@ -155,15 +155,14 @@ export default {
const min = Math.min(...value) || 0
//最小值的绝对值
// abs of min
const minAbs = Math.abs(min)
const max = Math.max(...value) || 0
//最小值的绝对值
// abs of max
const maxAbs = Math.abs(max)
//总数为最大值与最小值的绝对值相加
const total = max + minAbs
data = data.map((row, i) => ({ ...row, ranking: i + 1, percent: (row.value + minAbs) / total * 100 }))