1.0.0 • Published 4 years ago
@ali-i18n-fe/intl-comp-g2-chart-instance v1.0.0
G2ChartInstance
Usage
- add chartType in props
- add options in props
- move options.data to props.data
Formatter
推荐 1. 使用 JSFunction
{
"type": "JSFunction",
"value": "function (val, record, index){return val}"
}
会被注入 numeral: "value": "function (val, record, index){return numeral(val).add(0.2).value()}"
不推荐 2. 使用 JSExpression
{
"type": "JSExpression",
"value": "`${val}个`"
}
formatter 可用参数
path | params |
---|---|
label.formatter | val, record, index, numeral |
yAxis.label.formatter | val, record, index, numeral |
yAxis.leftConfig.label.formatter | val, record, index, numeral |
yAxis.rightConfig.label.formatter | val, record, index, numeral |
meta.*.formatter | val, numeral |
tooltip.formatter | x, y, type, numeral |
legend.text.formatter | text, cfg, numeral |
Development
install
yarn
start project
yarn start
build npm package
yarn babel
build umd package
yarn build
1.0.0
4 years ago