@ali-i18n-fe/intl-comp-g2-chart-instance

intl-comp-g2-chart-instance

Usage no npm install needed!

<script type="module">
  import aliI18nFeIntlCompG2ChartInstance from 'https://cdn.skypack.dev/@ali-i18n-fe/intl-comp-g2-chart-instance';
</script>

README

G2ChartInstance

Usage

  1. add chartType in props
  2. add options in props
  3. 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

[!DOCS_ALL-自动生成,请勿修改]

Development

install

yarn

start project

yarn start

build npm package

yarn babel

build umd package

yarn build