| | |
| | | text: '百分比' |
| | | }] |
| | | }, { |
| | | type: labelOptions.length > 2 ? 'select' : 'radio', |
| | | type: labelOptions.length > 20 ? 'select' : 'radio', |
| | | key: 'label', |
| | | label: '标签', |
| | | initVal: card.label || 'false', |
| | |
| | | key: 'area', |
| | | label: '面积图', |
| | | initVal: card.area || 'false', |
| | | // tooltip: '仅在形状为smooth时有效。', |
| | | required: false, |
| | | forbid: ['bar'].includes(card.chartType), |
| | | options: [{ |
| | |
| | | text: '极坐标' |
| | | }] |
| | | }, { |
| | | type: 'radio', |
| | | key: 'grid', |
| | | label: '网格线', |
| | | initVal: card.grid || 'show', |
| | | required: false, |
| | | options: [{ |
| | | value: 'show', |
| | | text: '显示' |
| | | }, { |
| | | value: 'hidden', |
| | | text: '隐藏' |
| | | }] |
| | | }, { |
| | | type: 'radio', |
| | | key: 'y_line', |
| | | label: 'y轴边线', |
| | | initVal: card.y_line || 'hidden', |
| | | tooltip: '图形左侧或右侧的边线。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'show', |
| | | text: '显示' |
| | | }, { |
| | | value: 'hidden', |
| | | text: '隐藏' |
| | | }] |
| | | }, { |
| | | type: 'number', |
| | | key: 'barSize', |
| | | label: '柱形宽度', |
| | |
| | | forbid: !['bar'].includes(card.chartType), |
| | | required: false |
| | | }, { |
| | | type: 'number', |
| | | key: 'min', |
| | | label: '最小值', |
| | | tooltip: 'y轴最小值,为空时自适应。', |
| | | initVal: card.min, |
| | | required: false |
| | | }, { |
| | | type: 'number', |
| | | key: 'max', |
| | | label: '最大值', |
| | | tooltip: 'y轴最大值,为空时自适应。', |
| | | initVal: card.max, |
| | | required: false |
| | | }, { |
| | | type: 'color', |
| | | key: 'color', |
| | | label: '色系', |
| | |
| | | required: false |
| | | }, { |
| | | type: 'color', |
| | | key: 'lineColor', |
| | | label: '轴线颜色', |
| | | initVal: card.lineColor, |
| | | tooltip: '坐标轴线的颜色,包括x轴、y轴及网格线。', |
| | | allowClear: true, |
| | | required: false |
| | | }, { |
| | | type: 'color', |
| | | key: 'selectColor', |
| | | label: '选中颜色', |
| | | initVal: card.selectColor || '', |
| | |
| | | title: '指标', |
| | | dataIndex: 'name', |
| | | editable: false, |
| | | width: '20%' |
| | | width: '14%' |
| | | }, |
| | | { |
| | | title: '形状', |
| | | dataIndex: 'shape', |
| | | inputType: 'cascader', |
| | | editable: true, |
| | | width: '20%', |
| | | width: '12%', |
| | | render: (text, record) => { |
| | | return text.join(' / ').replace('line', '折线').replace('bar', '柱形') |
| | | }, |
| | |
| | | dataIndex: 'axis', |
| | | inputType: 'select', |
| | | editable: true, |
| | | width: '20%', |
| | | width: '12%', |
| | | options: [ |
| | | { value: 'true', text: '显示'}, |
| | | { value: 'false', text: '隐藏'} |
| | |
| | | dataIndex: 'label', |
| | | inputType: 'select', |
| | | editable: true, |
| | | width: '20%', |
| | | width: '12%', |
| | | options: [ |
| | | { value: 'true', text: '显示'}, |
| | | { value: 'false', text: '隐藏'} |
| | |
| | | let trans = {'true': '显示', 'false': '隐藏'} |
| | | return trans[text] || '隐藏' |
| | | } |
| | | }, |
| | | { |
| | | title: '标题', |
| | | dataIndex: 'title', |
| | | inputType: 'select', |
| | | editable: true, |
| | | width: '12%', |
| | | options: [ |
| | | { value: 'true', text: '显示'}, |
| | | { value: 'false', text: '隐藏'} |
| | | ], |
| | | render: (text, record) => { |
| | | let trans = {'true': '显示', 'false': '隐藏'} |
| | | return trans[text] || '显示' |
| | | } |
| | | }, |
| | | { |
| | | title: '最小值', |
| | | dataIndex: 'min', |
| | | inputType: 'number', |
| | | editable: true, |
| | | required: false, |
| | | width: '12%' |
| | | }, |
| | | { |
| | | title: '最大值', |
| | | dataIndex: 'max', |
| | | inputType: 'number', |
| | | editable: true, |
| | | required: false, |
| | | width: '12%' |
| | | }, |
| | | ] |
| | | } |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Radio.Group disabled={item.readonly} onChange={(e) => this.radioChange(e, item.key)}> |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} disabled={item.readonly} onChange={(e) => this.radioChange(e, item.key)}> |
| | | {item.options.map(option => { |
| | | return ( |
| | | <Radio key={option.value} value={option.value}>{option.text}</Radio> |
| | |
| | | name: labels[item] || item, |
| | | axis: i === 0 ? 'true' : 'false', |
| | | label: 'false', |
| | | title: 'true', |
| | | shape: _plot.chartType === 'bar' && i === 0 ? ['bar', 'rect'] : ['line', 'smooth'] |
| | | } |
| | | }) |
| | |
| | | wrapClassName="popview-modal menu-chart-edit-modal" |
| | | title="图表编辑" |
| | | visible={visible} |
| | | width={850} |
| | | width={950} |
| | | maskClosable={false} |
| | | onOk={this.onSubmit} |
| | | onCancel={() => { this.setState({ visible: false }) }} |
| | |
| | | </Form.Item> |
| | | </Form> |
| | | </Col> |
| | | <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>注:使用自定义设置时,显示的坐标轴第一个在左侧,第二个在右侧,多余的不生效;柱形图只可以添加一个(设置多个时,第一个生效)。</Col> |
| | | <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>注:使用自定义设置时,显示的坐标轴第一个在左侧,第二个在右侧,多余的不生效。</Col> |
| | | <EditTable actions={['edit', 'move']} data={plot.customs || []} columns={cusColumns} onChange={this.changeCustom}/> |
| | | </TabPane> : null} |
| | | </Tabs> |
| | |
| | | .ant-input-number { |
| | | width: 100%; |
| | | } |
| | | .ant-radio-wrapper { |
| | | margin-right: 5px; |
| | | } |
| | | .ant-tabs-nav-wrap { |
| | | text-align: center; |
| | | } |
| | |
| | | |
| | | // chart.axis(X_axis, { label: { style: { fill: color } }, tickLine: {style: { stroke: color }}, line: { style: { stroke: color } } }) |
| | | // chart.axis('value', { grid: { line: { style: { stroke: color } }}, label: { style: { fill: color } } }) |
| | | chart.axis(X_axis, { label: { style: { fill: color } } }) |
| | | chart.axis('value', { label: { style: { fill: color } } }) |
| | | |
| | | let xc = {label: { style: { fill: color } }} |
| | | let yc = {label: { style: { fill: color } }} |
| | | if (plot.grid === 'hidden') { |
| | | yc.grid = null |
| | | } |
| | | if (plot.y_line === 'show') { |
| | | yc.line = {style: { stroke: '#D1D2CE' }} |
| | | } |
| | | if (plot.lineColor) { |
| | | xc.tickLine = {style: { stroke: plot.lineColor }} |
| | | xc.line = { style: { stroke: plot.lineColor } } |
| | | if (yc.grid !== null) { |
| | | yc.grid = { line: { style: { stroke: plot.lineColor } }} |
| | | } |
| | | if (yc.line) { |
| | | yc.line = { style: { stroke: plot.lineColor } } |
| | | } |
| | | } |
| | | chart.axis(X_axis, xc) |
| | | chart.axis('value', yc) |
| | | |
| | | if (plot.coordinate !== 'polar') { |
| | | chart.scale(X_axis, { |
| | |
| | | } |
| | | |
| | | if (plot.area === 'true') { |
| | | let area = chart.area().shape(plot.shape || 'smooth').position(`${X_axis}*value`).tooltip(false) |
| | | let area = chart.area().position(`${X_axis}*value`).tooltip(false) |
| | | if (plot.shape === 'smooth') { |
| | | area.shape('smooth') |
| | | } |
| | | if (plot.colors && plot.colors.length > 0) { |
| | | let limit = chartColors.length |
| | | area.color('key', (key) => { |
| | |
| | | let axisIndex = 0 |
| | | let hasBar = false |
| | | |
| | | plot.$paddingLeft = 30 |
| | | plot.$paddingRight = 30 |
| | | |
| | | plot.customs.forEach(item => { |
| | | item.name = transfield[item.type] || item.type |
| | | item.chartType = item.shape ? (item.shape[0] || 'bar') : 'bar' |
| | |
| | | if (item.axis === 'true' && axisIndex < 2) { |
| | | if (axisIndex === 0) { |
| | | // item.axis = { grid: {line: { style: { stroke: color } }}, title: { style: { fill: color } }, label: {style: { fill: color }} } |
| | | item.axis = { title: { style: { fill: color } }, label: {style: { fill: color }} } |
| | | item.axis = { label: {style: { fill: color }} } |
| | | if (item.title !== 'false') { |
| | | item.axis.title = { style: { fill: color } } |
| | | plot.$paddingLeft = 50 |
| | | } |
| | | if (plot.grid === 'hidden') { |
| | | item.axis.grid = null |
| | | } |
| | | if (plot.y_line === 'show') { |
| | | item.axis.line = {style: { stroke: '#D1D2CE' }} |
| | | } |
| | | if (plot.lineColor) { |
| | | if (item.axis.grid !== null) { |
| | | item.axis.grid = { line: { style: { stroke: plot.lineColor } }} |
| | | } |
| | | if (item.axis.line) { |
| | | item.axis.line = { style: { stroke: plot.lineColor } } |
| | | } |
| | | } |
| | | |
| | | fields.unshift(item) |
| | | } else { |
| | | item.axis = { grid: null, title: {style: { fill: color }}, label: {style: { fill: color }} } |
| | | item.axis = { grid: null, label: {style: { fill: color }} } |
| | | if (item.title !== 'false') { |
| | | item.axis.title = { style: { fill: color } } |
| | | plot.$paddingRight = 60 |
| | | } |
| | | if (plot.y_line === 'show') { |
| | | item.axis.line = {style: { stroke: '#D1D2CE' }} |
| | | } |
| | | if (plot.lineColor && item.axis.line) { |
| | | item.axis.line = { style: { stroke: plot.lineColor } } |
| | | } |
| | | fields.splice(1, 0, item) |
| | | } |
| | | axisIndex++ |
| | |
| | | } |
| | | |
| | | if (!Bar_axis.length) { |
| | | if (axisIndex === 2) { |
| | | padding = [10, 50, 30, 50] |
| | | } else if (axisIndex === 1) { |
| | | padding = [10, 30, 30, 50] |
| | | } |
| | | padding = [10, plot.$paddingRight, 30, plot.$paddingLeft] |
| | | } |
| | | |
| | | const chart = new Chart({ |
| | |
| | | }) |
| | | |
| | | // chart.axis(plot.Xaxis, { label: { style: { fill: color } }, tickLine: {style: { stroke: color }}, line: { style: { stroke: color } } }) |
| | | chart.axis(plot.Xaxis, { label: { style: { fill: color } } }) |
| | | |
| | | let xc = {label: { style: { fill: color } }} |
| | | if (plot.lineColor) { |
| | | xc.tickLine = {style: { stroke: plot.lineColor }} |
| | | xc.line = { style: { stroke: plot.lineColor } } |
| | | } |
| | | chart.axis(plot.Xaxis, xc) |
| | | |
| | | if (!hasBar) { |
| | | chart.scale(plot.Xaxis, { |
| | |
| | | nice: true, |
| | | range: [0, 0.9] |
| | | }) |
| | | |
| | | let yc = {label: { style: { fill: color } }} |
| | | if (plot.grid === 'hidden') { |
| | | yc.grid = null |
| | | } |
| | | if (plot.y_line === 'show') { |
| | | yc.line = {style: { stroke: '#D1D2CE' }} |
| | | } |
| | | if (plot.lineColor) { |
| | | if (yc.grid !== null) { |
| | | yc.grid = { line: { style: { stroke: plot.lineColor } }} |
| | | } |
| | | if (yc.line) { |
| | | yc.line = { style: { stroke: plot.lineColor } } |
| | | } |
| | | } |
| | | view1.axis('value', yc) |
| | | |
| | | view1.legend(false) |
| | | |
| | |
| | | |
| | | // chart.axis(X_axis, { label: { style: { fill: color } }, tickLine: {style: { stroke: color }}, line: { style: { stroke: color } } }) |
| | | // chart.axis('value', { grid: { line: { style: { stroke: color } }}, label: { style: { fill: color } } }) |
| | | chart.axis(X_axis, { label: { style: { fill: color } } }) |
| | | chart.axis('value', { label: { style: { fill: color } } }) |
| | | |
| | | let xc = {label: { style: { fill: color } }} |
| | | let yc = {label: { style: { fill: color } }} |
| | | if (plot.grid === 'hidden') { |
| | | yc.grid = null |
| | | } |
| | | if (plot.y_line === 'show') { |
| | | yc.line = {style: { stroke: '#D1D2CE' }} |
| | | } |
| | | if (plot.lineColor) { |
| | | xc.tickLine = {style: { stroke: plot.lineColor }} |
| | | xc.line = { style: { stroke: plot.lineColor } } |
| | | if (yc.grid !== null) { |
| | | yc.grid = { line: { style: { stroke: plot.lineColor } }} |
| | | } |
| | | if (yc.line) { |
| | | yc.line = { style: { stroke: plot.lineColor } } |
| | | } |
| | | } |
| | | chart.axis(X_axis, xc) |
| | | chart.axis('value', yc) |
| | | |
| | | chart.scale('value', { |
| | | nice: true, |
| | |
| | | const { group } = this.state |
| | | let _style = resetStyle(group.style) |
| | | |
| | | let paddingTop = true |
| | | if (group.style.paddingTop && parseInt(group.style.paddingTop) >= 28) { |
| | | paddingTop = false |
| | | } |
| | | |
| | | return ( |
| | | <div className="menu-group-edit-box" style={_style} onClick={this.clickComponent} id={group.uuid}> |
| | | <div className={'menu-group-edit-box' + (paddingTop ? ' padding' : '')} style={_style} onClick={this.clickComponent} id={group.uuid}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <SettingComponent config={group} updateConfig={this.updateComponent} /> |
| | |
| | | color: #bcbcbc; |
| | | } |
| | | } |
| | | .menu-group-edit-box::before { |
| | | .menu-group-edit-box.padding:before { |
| | | content: ' '; |
| | | display: block; |
| | | float: right; |
| | |
| | | position: relative; |
| | | z-index: 13; |
| | | background:#ffffff; |
| | | } |
| | | .menu-view { |
| | | .anticon-tool { |
| | | display: none; |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | let padding = 0 |
| | | if (_config.style.paddingTop && !isNaN(parseInt(_config.style.paddingTop))) { |
| | | padding += parseInt(_config.style.paddingTop) |
| | | } |
| | | if (_config.style.paddingBottom && !isNaN(parseInt(_config.style.paddingBottom))) { |
| | | padding += parseInt(_config.style.paddingBottom) |
| | | } |
| | | |
| | | let height = config.plot.height || 400 |
| | | if (config.plot.title || config.search.length > 0) { |
| | | _config.plot.height = height - 70 |
| | | _config.plot.height = height - 70 - padding |
| | | } else { |
| | | _config.plot.height = height - 25 |
| | | _config.plot.height = height - 25 - padding |
| | | } |
| | | |
| | | _config.style.height = height |
| | |
| | | _config.plot.$colors = colors |
| | | } |
| | | |
| | | let xc = {label: { |
| | | formatter: (val) => { |
| | | if (!val || /^\s*$/.test(val)) return val |
| | | let _val = `${val}` |
| | | if (_val.length <= 11) return val |
| | | return _val.substring(0, 8) + '...' |
| | | }, |
| | | 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') { |
| | | yc.line = {style: { stroke: '#D1D2CE' }} |
| | | } |
| | | if (_config.plot.lineColor) { |
| | | xc.tickLine = {style: { stroke: _config.plot.lineColor }} |
| | | xc.line = { style: { stroke: _config.plot.lineColor } } |
| | | if (yc.grid !== null) { |
| | | yc.grid = { line: { style: { stroke: _config.plot.lineColor } }} |
| | | } |
| | | if (yc.line) { |
| | | yc.line = { style: { stroke: _config.plot.lineColor } } |
| | | } |
| | | } |
| | | |
| | | _config.plot.$xc = xc |
| | | _config.plot.$yc = yc |
| | | |
| | | _config.plot.$paddingLeft = 30 |
| | | _config.plot.$paddingRight = 30 |
| | | |
| | | if (_config.plot.enabled === 'true') { |
| | | let colorIndex = 0 |
| | | let limit = chartColors.length |
| | |
| | | |
| | | if (item.axis === 'true' && axisIndex < 2) { |
| | | if (axisIndex === 0) { |
| | | item.axis = { title: { style: { fill: _config.plot.color } }, label: {style: { fill: _config.plot.color }} } |
| | | item.axis = { label: {style: { fill: _config.plot.color }} } |
| | | if (item.title !== 'false') { |
| | | item.axis.title = { style: { fill: _config.plot.color } } |
| | | _config.plot.$paddingLeft = 50 |
| | | } |
| | | if (_config.plot.grid === 'hidden') { |
| | | item.axis.grid = null |
| | | } |
| | | if (_config.plot.y_line === 'show') { |
| | | item.axis.line = {style: { stroke: '#D1D2CE' }} |
| | | } |
| | | if (_config.plot.lineColor) { |
| | | if (item.axis.grid !== null) { |
| | | item.axis.grid = { line: { style: { stroke: _config.plot.lineColor } }} |
| | | } |
| | | if (item.axis.line) { |
| | | item.axis.line = { style: { stroke: _config.plot.lineColor } } |
| | | } |
| | | } |
| | | fields.unshift(item) |
| | | } else { |
| | | item.axis = { grid: null, title: {style: { fill: _config.plot.color }}, label: {style: { fill: _config.plot.color }} } |
| | | item.axis = { grid: null, label: {style: { fill: _config.plot.color }} } |
| | | if (item.title !== 'false') { |
| | | item.axis.title = { style: { fill: _config.plot.color } } |
| | | _config.plot.$paddingRight = 60 |
| | | } |
| | | if (_config.plot.y_line === 'show') { |
| | | item.axis.line = {style: { stroke: '#D1D2CE' }} |
| | | } |
| | | if (_config.plot.lineColor && item.axis.line) { |
| | | item.axis.line = { style: { stroke: _config.plot.lineColor } } |
| | | } |
| | | fields.splice(1, 0, item) |
| | | } |
| | | axisIndex++ |
| | |
| | | range: [0, 1] |
| | | }) |
| | | } |
| | | chart.scale(_valfield, { |
| | | |
| | | let c = { |
| | | nice: true, |
| | | range: [0, 0.9] |
| | | }) |
| | | |
| | | // 坐标轴格式化 |
| | | chart.axis(plot.Xaxis, { |
| | | label: { |
| | | formatter: (val) => { |
| | | if (!val || /^\s*$/.test(val)) return val |
| | | let _val = `${val}` |
| | | if (_val.length <= 11) return val |
| | | return _val.substring(0, 8) + '...' |
| | | }, |
| | | style: { fill: plot.color } |
| | | }, |
| | | }) |
| | | chart.axis(_valfield, { label: { style: { fill: plot.color } } }) |
| | | } |
| | | |
| | | if (plot.min || plot.min === 0) { |
| | | c.min = plot.min |
| | | } |
| | | if (plot.max || plot.max === 0) { |
| | | c.max = plot.max |
| | | } |
| | | chart.scale(_valfield, c) |
| | | |
| | | chart.axis(plot.Xaxis, plot.$xc) |
| | | chart.axis(_valfield, plot.$yc) |
| | | |
| | | if (!plot.legend || plot.legend === 'hidden') { |
| | | chart.legend(false) |
| | |
| | | if (plot.area === 'true') { |
| | | let area = chart |
| | | .area() |
| | | .shape(plot.shape || 'smooth') |
| | | // .shape(plot.shape || 'smooth') |
| | | .position(`${plot.Xaxis}*${_valfield}`) |
| | | .tooltip(false) |
| | | |
| | | if (plot.shape === 'smooth') { |
| | | area.shape('smooth') |
| | | } |
| | | if (plot.$colors) { |
| | | let limit = chartColors.length |
| | | area.color(_typefield, (key) => { |
| | |
| | | let padding = [10, 30, 30, 30] |
| | | |
| | | if (!plot.Bar_axis) { |
| | | if (plot.axisIndex === 2) { |
| | | padding = [10, 50, 30, 50] |
| | | } else if (plot.axisIndex === 1) { |
| | | padding = [10, 30, 30, 50] |
| | | } |
| | | padding = [10, plot.$paddingRight, 30, plot.$paddingLeft] |
| | | } |
| | | |
| | | const chart = new Chart({ |
| | |
| | | }) |
| | | |
| | | // 坐标轴格式化 |
| | | chart.axis(plot.Xaxis, { |
| | | label: { |
| | | formatter: (val) => { |
| | | if (!val || /^\s*$/.test(val)) return val |
| | | let _val = `${val}` |
| | | if (_val.length <= 11) return val |
| | | return _val.substring(0, 8) + '...' |
| | | }, |
| | | style: { fill: plot.color } |
| | | }, |
| | | }) |
| | | chart.axis(plot.Xaxis, plot.$xc) |
| | | |
| | | if (!plot.hasBar) { |
| | | chart.scale(plot.Xaxis, { |
| | |
| | | |
| | | view1.data(dvt.rows) |
| | | |
| | | view1.scale('value', { |
| | | let c = { |
| | | nice: true, |
| | | range: [0, 0.9] |
| | | }) |
| | | } |
| | | |
| | | if (plot.min || plot.min === 0) { |
| | | c.min = plot.min |
| | | } |
| | | if (plot.max || plot.max === 0) { |
| | | c.max = plot.max |
| | | } |
| | | view1.scale('value', c) |
| | | view1.axis('value', plot.$yc) |
| | | |
| | | view1.legend(false) |
| | | |
| | |
| | | if (item.chartType === 'bar' && !plot.Bar_axis) { |
| | | view2.axis(item.name, item.axis) |
| | | |
| | | view2.scale(item.name, { |
| | | let c = { |
| | | nice: true, |
| | | range: [0, 0.9] |
| | | }) |
| | | } |
| | | |
| | | if (item.min || item.min === 0) { |
| | | c.min = item.min |
| | | } |
| | | if (item.max || item.max === 0) { |
| | | c.max = item.max |
| | | } |
| | | |
| | | view2.scale(item.name, c) |
| | | let _chart = view2 |
| | | .interval() |
| | | .position(`${plot.Xaxis}*${item.name}`) |
| | |
| | | } else { |
| | | view2.axis(item.name, { grid: null, title: null, label: null }) |
| | | } |
| | | view2.scale(item.name, { |
| | | let c = { |
| | | nice: true, |
| | | range: [0, 0.9] |
| | | }) |
| | | } |
| | | |
| | | if (item.min || item.min === 0) { |
| | | c.min = item.min |
| | | } |
| | | if (item.max || item.max === 0) { |
| | | c.max = item.max |
| | | } |
| | | |
| | | view2.scale(item.name, c) |
| | | let _chart = view2 |
| | | .line() |
| | | .position(`${plot.Xaxis}*${item.name}`) |
| | |
| | | |
| | | chart.data(_data) |
| | | |
| | | chart.scale(_valfield, { |
| | | let c = { |
| | | nice: true, |
| | | range: [0, 0.9] |
| | | }) |
| | | } |
| | | |
| | | // 坐标轴格式化 |
| | | chart.axis(plot.Xaxis, { |
| | | label: { |
| | | formatter: (val) => { |
| | | if (!val || /^\s*$/.test(val)) return val |
| | | let _val = `${val}` |
| | | if (_val.length <= 11) return val |
| | | return _val.substring(0, 8) + '...' |
| | | }, |
| | | style: { fill: plot.color } |
| | | }, |
| | | }) |
| | | chart.axis(_valfield, { label: { style: { fill: plot.color } } }) |
| | | if (plot.min || plot.min === 0) { |
| | | c.min = plot.min |
| | | } |
| | | if (plot.max || plot.max === 0) { |
| | | c.max = plot.max |
| | | } |
| | | chart.scale(_valfield, c) |
| | | |
| | | chart.axis(plot.Xaxis, plot.$xc) |
| | | chart.axis(_valfield, plot.$yc) |
| | | |
| | | if (!plot.legend || plot.legend === 'hidden') { |
| | | chart.legend(false) |
| | |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | <div className={'menu-body ' + (menuloading ? 'saving' : '')}> |
| | | <div className={'menu-body menu-view' + (menuloading ? 'saving' : '')}> |
| | | {config && !comloading ? <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}> |
| | | <MobShell menu={config} handleList={this.updateConfig} /> |
| | | </div> : null} |
| | |
| | | overflow-y: auto; |
| | | |
| | | } |
| | | .menu-body.saving { |
| | | .menu-body.saving, .menu-view.saving { |
| | | .anticon-tool { |
| | | display: none; |
| | | } |
| | |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | <div className={'menu-body ' + (menuloading ? 'saving' : '')}> |
| | | <div className={'menu-body menu-view' + (menuloading ? 'saving' : '')}> |
| | | {config && !comloading ? <MenuShell menu={config} handleList={this.updateConfig} /> : null} |
| | | </div> |
| | | </DndProvider> |
| | |
| | | margin: 0 auto; |
| | | } |
| | | } |
| | | .menu-body.saving { |
| | | .menu-body.saving, .menu-view.saving { |
| | | .anticon-tool { |
| | | display: none; |
| | | } |