| | |
| | | import { Chart } from '@antv/g2' |
| | | import DataSet from '@antv/data-set' |
| | | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import ChartCompileForm from './chartcompile' |
| | | import './index.scss' |
| | | |
| | |
| | | } |
| | | |
| | | state = { |
| | | dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS, |
| | | visible: true |
| | | } |
| | | |
| | |
| | | if (plot.label === 'true') { |
| | | _chart.label('value') |
| | | } |
| | | if (plot.barSize || plot.correction) { |
| | | _chart.size(plot.barSize || 35) |
| | | } |
| | | } else if (plot.adjust === 'stack') { |
| | | let _chart = chart |
| | | .interval() |
| | |
| | | |
| | | if (plot.label === 'true') { |
| | | _chart.label('value') |
| | | } |
| | | |
| | | if (plot.barSize || plot.correction) { |
| | | _chart.size(plot.barSize || 35) |
| | | } |
| | | } |
| | | |
| | |
| | | type: 'overlap' |
| | | } |
| | | setting.offset = 0 |
| | | // setting.style = { |
| | | // textAlign: 'center', |
| | | // fontSize: 12, |
| | | // fill: '#535353' |
| | | // } |
| | | } |
| | | |
| | | _chart.label('percent', setting) |
| | |
| | | plot={plot} |
| | | type={plot.chartType} |
| | | config={this.props.config} |
| | | dict={this.state.dict} |
| | | plotchange={this.plotChange} |
| | | /> |
| | | </div> |