| | |
| | | }, { |
| | | type: 'radio', |
| | | key: 'show', |
| | | label: '格式化', |
| | | label: '显示', |
| | | initVal: card.show || 'value', |
| | | required: false, |
| | | options: [{ |
| | | value: 'value', |
| | | text: '无' |
| | | text: '数值' |
| | | }, { |
| | | value: 'percent', |
| | | text: '百分比' |
| | |
| | | } |
| | | }, |
| | | { |
| | | title: '显示', |
| | | dataIndex: 'show', |
| | | inputType: 'select', |
| | | editable: true, |
| | | required: false, |
| | | width: '12%', |
| | | options: [ |
| | | { value: 'value', text: '数值'}, |
| | | { value: 'percent', text: '百分比'} |
| | | ], |
| | | render: (text, record) => { |
| | | let trans = {'value': '数值', 'percent': '百分比'} |
| | | return trans[text] || '' |
| | | } |
| | | }, |
| | | { |
| | | title: '最小值', |
| | | dataIndex: 'min', |
| | | inputType: 'number', |
| | |
| | | </Form> |
| | | </Col> |
| | | <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>注:使用自定义设置时,显示的坐标轴第一个在左侧,第二个在右侧,多余的不生效。</Col> |
| | | <EditTable actions={['edit', 'move']} data={plot.customs || []} columns={cusColumns} onChange={this.changeCustom}/> |
| | | <EditTable indexShow={false} actions={['edit', 'move']} data={plot.customs || []} columns={cusColumns} onChange={this.changeCustom}/> |
| | | </TabPane> : null} |
| | | </Tabs> |
| | | </Modal> |
| | |
| | | item.name = transfield[item.type] || item.type |
| | | item.chartType = item.shape ? (item.shape[0] || 'bar') : 'bar' |
| | | item.shape = item.shape ? (item.shape[1] || '') : '' |
| | | item.show = item.show || plot.show |
| | | |
| | | if (colors.has(item.name)) { |
| | | item.color = colors.get(item.name) |
| | |
| | | .color(item.color) |
| | | .shape(item.shape) |
| | | .tooltip(`${item.name}`, (value) => { |
| | | if (plot.show === 'percent') { |
| | | if (item.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | return { |
| | |
| | | } |
| | | if (item.label !== 'false') { |
| | | _chart.label(item.name, (value) => { |
| | | if (plot.show === 'percent') { |
| | | if (item.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | |
| | |
| | | .color(item.color) |
| | | .shape(item.shape) |
| | | .tooltip(`${item.name}`, (value) => { |
| | | if (plot.show === 'percent') { |
| | | if (item.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | return { |
| | |
| | | |
| | | if (item.label !== 'false') { |
| | | _chart.label(item.name, (value) => { |
| | | if (plot.show === 'percent') { |
| | | if (item.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | let _color = color |
| | |
| | | |
| | | _config.plot.hasBar = Bar_axis.length > 0 |
| | | |
| | | if (_config.plot.mutilBar !== 'overlap') { |
| | | if (_config.plot.mutilBar !== 'overlap' && Bar_axis.length > 1) { |
| | | _config.plot.Bar_axis = Bar_axis |
| | | } |
| | | } else { |
| | |
| | | let axisIndex = 0 |
| | | let fields = [] |
| | | let legends = [] |
| | | |
| | | let vFieldsShow = {} |
| | | |
| | | _config.plot.customs.forEach(item => { |
| | | if (colors.has(item.name)) { |
| | | item.color = colors.get(item.name) |
| | |
| | | name: item.name, |
| | | marker: { symbol: item.chartType === 'bar' ? 'square' : 'hyphen', style: { stroke: item.color,fill: item.color, r: 5, lineWidth: 2 } } |
| | | }) |
| | | |
| | | if ((!_config.plot.Bar_axis || item.chartType !== 'bar') && item.show) { // 折线图或重叠下的柱状图可单独设置显示类型 |
| | | vFieldsShow[item.type] = item.show |
| | | } |
| | | }) |
| | | _config.plot.customs = fields |
| | | _config.plot.legends = legends |
| | | _config.plot.axisIndex = axisIndex |
| | | vFields.forEach(item => { |
| | | if (vFieldsShow[item.field]) { |
| | | item.show = vFieldsShow[item.field] |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | view2.data(dv.rows) |
| | | view2.legend(false) |
| | | |
| | | plot.customs.forEach((item, i) => { |
| | | plot.customs.forEach(item => { |
| | | if (item.chartType === 'bar' && !plot.Bar_axis) { |
| | | view2.axis(item.name, item.axis) |
| | | |
| | |
| | | .tooltip(`${item.name}`, (value) => { |
| | | return { |
| | | name: item.name, |
| | | value: plot.show === 'percent' ? value + '%' : value |
| | | value: item.show === 'percent' ? value + '%' : value |
| | | } |
| | | }) |
| | | |
| | |
| | | } |
| | | if (item.label !== 'false') { |
| | | _chart.label(item.name, (value) => { |
| | | if (plot.show === 'percent') { |
| | | if (item.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.label === 'true' && plot.labelColor === 'custom' && item.color) { |
| | |
| | | .tooltip(`${item.name}`, (value) => { |
| | | return { |
| | | name: item.name, |
| | | value: plot.show === 'percent' ? value + '%' : value |
| | | value: item.show === 'percent' ? value + '%' : value |
| | | } |
| | | }) |
| | | |
| | | if (item.label === 'true') { |
| | | _chart.label(item.name, (value) => { |
| | | if (plot.show === 'percent') { |
| | | if (item.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | return { |