| | |
| | | required: false, |
| | | options: labelOptions, |
| | | controlFields: [ |
| | | {field: 'labelColor', values: ['true']} |
| | | {field: 'labelUnit', values: ['true', 'top', 'middle', 'bottom']} |
| | | ] |
| | | }, { |
| | | type: 'radio', |
| | |
| | | forbid: appType === 'mob', |
| | | required: false |
| | | }, { |
| | | type: 'text', |
| | | field: 'labelUnit', |
| | | label: '标注单位', |
| | | initval: card.labelUnit ||'', |
| | | forbid: appType === 'mob', |
| | | required: false |
| | | }, { |
| | | type: 'color', |
| | | field: 'lineColor', |
| | | label: '坐标轴颜色', |
| | |
| | | if (plot.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.labelUnit) { |
| | | value = value + plot.labelUnit |
| | | } |
| | | let _color = color |
| | | |
| | | if (plot.labelColor === 'custom' && colors.has(key)) { |
| | |
| | | if (plot.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.labelUnit) { |
| | | value = value + plot.labelUnit |
| | | } |
| | | |
| | | if (label === 'true' && plot.labelColor === 'custom' && colors.has(key)) { |
| | | lablecfg.style.fill = colors.get(key) |
| | |
| | | _chart.label('value*key', (value, key) => { |
| | | if (plot.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.labelUnit) { |
| | | value = value + plot.labelUnit |
| | | } |
| | | |
| | | if (label === 'true' && plot.labelColor === 'custom' && colors.has(key)) { |
| | |
| | | if (item.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.labelUnit) { |
| | | value = value + plot.labelUnit |
| | | } |
| | | |
| | | if (plot.label === 'true' && plot.labelColor === 'custom') { |
| | | lablecfg.style.fill = item.color |
| | |
| | | _chart.label(item.name, (value) => { |
| | | if (item.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.labelUnit) { |
| | | value = value + plot.labelUnit |
| | | } |
| | | let _color = color |
| | | |
| | |
| | | if (plot.grid === 'hidden') { |
| | | yc.grid = null |
| | | } |
| | | if (plot.y_line === 'show') { |
| | | if (plot.tick === 'hidden') { |
| | | xc.tickLine = null |
| | | } |
| | | if (plot.x_line === 'hidden') { |
| | | xc.line = null |
| | | } |
| | | if (plot.y_line === 'hidden') { |
| | | yc.line = null |
| | | } else { |
| | | yc.line = {style: { stroke: '#D1D2CE' }} |
| | | } |
| | | if (plot.x_label === 'hidden') { |
| | | xc.label = null |
| | | } |
| | | if (plot.y_label === 'hidden') { |
| | | yc.label = null |
| | | } |
| | | |
| | | if (plot.lineColor) { |
| | | if (xc.tickLine !== null) { |
| | | xc.tickLine = {style: { stroke: plot.lineColor }} |
| | | } |
| | | if (xc.line !== null) { |
| | | xc.line = { style: { stroke: plot.lineColor } } |
| | | } |
| | | if (yc.grid !== null) { |
| | | yc.grid = { line: { style: { stroke: plot.lineColor } }} |
| | | } |
| | |
| | | if (plot.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.labelUnit) { |
| | | value = value + plot.labelUnit |
| | | } |
| | | |
| | | if (plot.label === 'true' && plot.labelColor === 'custom' && colors.has(key)) { |
| | | lablecfg.style.fill = colors.get(key) |
| | |
| | | if (plot.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.labelUnit) { |
| | | value = value + plot.labelUnit |
| | | } |
| | | |
| | | if (plot.label === 'true' && plot.labelColor === 'custom' && colors.has(key)) { |
| | | lablecfg.style.fill = colors.get(key) |
| | |
| | | style: { fill: _config.plot.color } |
| | | }} |
| | | let yc = {label: { style: { fill: _config.plot.color } }} |
| | | |
| | | if (_config.plot.grid === 'hidden') { |
| | | yc.grid = null |
| | | } |
| | | if (_config.plot.y_line === 'show') { |
| | | if (_config.plot.tick === 'hidden') { |
| | | xc.tickLine = null |
| | | } |
| | | if (_config.plot.x_line === 'hidden') { |
| | | xc.line = null |
| | | } |
| | | if (_config.plot.y_line === 'hidden') { |
| | | yc.line = null |
| | | } else { |
| | | yc.line = {style: { stroke: '#D1D2CE' }} |
| | | } |
| | | if (_config.plot.x_label === 'hidden') { |
| | | xc.label = null |
| | | } |
| | | if (_config.plot.y_label === 'hidden') { |
| | | yc.label = null |
| | | } |
| | | |
| | | if (_config.plot.lineColor) { |
| | | if (xc.tickLine !== null) { |
| | | xc.tickLine = {style: { stroke: _config.plot.lineColor }} |
| | | } |
| | | if (xc.line !== null) { |
| | | xc.line = { style: { stroke: _config.plot.lineColor } } |
| | | } |
| | | if (yc.grid !== null) { |
| | | yc.grid = { line: { style: { stroke: _config.plot.lineColor } }} |
| | | } |
| | |
| | | val = val + '' |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | if (plot.labelUnit) { |
| | | val = val + plot.labelUnit |
| | | } |
| | | return { |
| | | content: val, |
| | | style: { |
| | |
| | | val = val + '' |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | if (plot.labelUnit) { |
| | | val = val + plot.labelUnit |
| | | } |
| | | |
| | | if (plot.$label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) { |
| | | lablecfg.style.fill = plot.$colors.get(key) |
| | |
| | | } else if (plot.show === 'thdSeparator') { |
| | | val = val + '' |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | if (plot.labelUnit) { |
| | | val = val + plot.labelUnit |
| | | } |
| | | if (plot.$label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) { |
| | | lablecfg.style.fill = plot.$colors.get(key) |
| | |
| | | val = val + '' |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | if (plot.labelUnit) { |
| | | val = val + plot.labelUnit |
| | | } |
| | | if (plot.label === 'true' && plot.labelColor === 'custom' && item.color) { |
| | | lablecfg.style.fill = item.color |
| | | } |
| | |
| | | } else if (item.show === 'thdSeparator') { |
| | | val = val + '' |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | if (plot.labelUnit) { |
| | | val = val + plot.labelUnit |
| | | } |
| | | |
| | | return { |
| | |
| | | val = val + '' |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | if (plot.labelUnit) { |
| | | val = val + plot.labelUnit |
| | | } |
| | | |
| | | if (plot.label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) { |
| | | lablecfg.style.fill = plot.$colors.get(key) |
| | |
| | | val = val + '' |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | if (plot.labelUnit) { |
| | | val = val + plot.labelUnit |
| | | } |
| | | |
| | | if (plot.label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) { |
| | | lablecfg.style.fill = plot.$colors.get(key) |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { Chart, registerShape } from '@antv/g2' |
| | | import { Spin, notification, Modal } from 'antd' |
| | | import { DownloadOutlined } from '@ant-design/icons' |
| | | // import { DownloadOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | |
| | | } |
| | | <NormalHeader config={config} /> |
| | | <div className="canvas-wrap"> |
| | | {config.plot.download === 'enable' && this.state.chart ? <DownloadOutlined onClick={this.downloadImage} className="system-color download"/> : null} |
| | | {/* {config.plot.download === 'enable' && this.state.chart ? <DownloadOutlined onClick={this.downloadImage} className="system-color download"/> : null} */} |
| | | <div className="canvas" id={this.state.chartId}></div> |
| | | </div> |
| | | </div> |
| | |
| | | import { Chart } from '@antv/g2' |
| | | import DataSet, { DataView } from '@antv/data-set' |
| | | import { Spin, Empty, notification, Modal } from 'antd' |
| | | import { DownloadOutlined } from '@ant-design/icons' |
| | | // import { DownloadOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | |
| | | } |
| | | <NormalHeader config={config} BID={BID} refresh={this.refreshSearch} /> |
| | | <div className="canvas-wrap"> |
| | | {config.plot.download === 'enable' && this.state.chart && !empty ? <DownloadOutlined onClick={this.downloadImage} className="system-color download"/> : null} |
| | | {/* {config.plot.download === 'enable' && this.state.chart && !empty ? <DownloadOutlined onClick={this.downloadImage} className="system-color download"/> : null} */} |
| | | <div className={'canvas' + (empty ? ' empty' : '')} id={this.state.chartId}></div> |
| | | </div> |
| | | {empty ? <Empty description={false}/> : null} |
| | |
| | | } |
| | | |
| | | if (!err) { |
| | | if (/^[\s\n]+$/.test(values.sql)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请输入sql!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | values.uuid = editItem ? editItem.uuid : '' |
| | | values.position = values.position || (editItem ? editItem.position : 'front') |
| | | |
| | |
| | | |
| | | if (card.$c_ds) { |
| | | columns = card.columns.map(c => c.field) |
| | | |
| | | if (card.setting.primaryKey && !columns.includes(card.setting.primaryKey)) { |
| | | let key = card.setting.primaryKey.toLowerCase() |
| | | columns.forEach(f => { |
| | | if (f.toLowerCase() === key) { |
| | | card.setting.primaryKey = f |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (card.setting.interType === 'system' && card.setting.execute !== 'false' && !card.setting.dataresource) { |
| | | errors.push({ level: 0, detail: '未设置数据源!'}) |
| | | } else if (card.setting.interType === 'system' && card.setting.execute === 'false' && card.scripts.filter(script => script.status !== 'false').length === 0) { |