src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/menu/components/chart/antv-bar/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/menu/components/chart/antv-dashboard/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/menu/components/chart/antv-pie/chartcompile/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/menu/components/chart/antv-pie/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/menu/components/chart/antv-scatter/chartcompile/formconfig.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/menu/components/chart/antv-scatter/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/tabviews/custom/components/chart/antv-bar-line/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/tabviews/custom/components/chart/antv-pie/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/tabviews/custom/components/chart/antv-scatter/index.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx
@@ -387,6 +387,27 @@ initVal: card.color || 'rgba(0, 0, 0, 0.65)', tooltip: '坐标轴提示文字及示例的颜色。', required: false }, { type: 'select', key: 'interaction', label: '交互效果', initVal: card.interaction || [], multi: true, required: false, options: [ { value: 'element-active', label: '元素聚焦' }, { value: 'element-selected', label: '元素选中(多选)' }, { value: 'element-single-selected', label: '元素选中(单选)' }, { value: 'active-region', label: '背景框' }, { value: 'view-zoom', label: '视图缩放' }, { value: 'element-highlight', label: '元素高亮' }, { value: 'element-highlight-by-color', label: '同色元素高亮' }, { value: 'element-highlight-by-x', label: '同X轴元素高亮' }, { value: 'legend-filter', label: '图例过滤' }, { value: 'legend-active', label: '图例聚焦' }, { value: 'legend-highlight', label: '图例高亮' }, { value: 'brush', label: '选框过滤' }, ] } ] } src/menu/components/chart/antv-bar/index.jsx
@@ -349,6 +349,12 @@ .size(3) .shape('circle') } if (plot.interaction && plot.interaction.length) { plot.interaction.forEach(t => { chart.interaction(t) }) } chart.render() } else { this.customrender(data) @@ -535,7 +541,6 @@ }) view1.data(dvt.rows) view1.interaction('other-visible') view1.scale('value', { nice: true, range: [0, 0.9] @@ -567,7 +572,6 @@ if (plot.colors && plot.colors.length > 0) { let limit = chartColors.length _chart.color('key', (key) => { // return 'l(90) 0:#1890ff 1:#70cdd0' if (colors.has(key)) { return colors.get(key) } else { @@ -659,7 +663,6 @@ }) view2.data(dv.rows) view2.interaction('other-visible') view2.legend(false) @@ -755,6 +758,14 @@ } } }) if (plot.interaction && plot.interaction.length) { plot.interaction.forEach(t => { if (t === 'element-active' || t === 'element-highlight') { chart.interaction(t) } }) } chart.render() } @@ -969,6 +980,12 @@ } } if (plot.interaction && plot.interaction.length) { plot.interaction.forEach(t => { chart.interaction(t) }) } chart.render() } else { this.customrender(data) src/menu/components/chart/antv-dashboard/index.jsx
@@ -309,7 +309,7 @@ textAlign: 'center', }, offsetY: 15, }); }) chart.render() } src/menu/components/chart/antv-pie/chartcompile/formconfig.jsx
@@ -287,6 +287,27 @@ initVal: card.color || 'rgba(0, 0, 0, 0.85)', tooltip: '坐标轴及示例等提示文字使用的颜色。', required: false }, { type: 'select', key: 'interaction', label: '交互效果', initVal: card.interaction || [], multi: true, required: false, options: [ { value: 'element-active', label: '元素聚焦' }, { value: 'element-selected', label: '元素选中(多选)' }, { value: 'element-single-selected', label: '元素选中(单选)' }, // { value: 'active-region', label: '背景框' }, // { value: 'view-zoom', label: '视图缩放' }, { value: 'element-highlight', label: '元素高亮' }, // { value: 'element-highlight-by-color', label: '同色元素高亮' }, // { value: 'element-highlight-by-x', label: '同X轴元素高亮' }, { value: 'legend-filter', label: '图例过滤' }, { value: 'legend-active', label: '图例聚焦' }, { value: 'legend-highlight', label: '图例高亮' }, // { value: 'brush', label: '选框过滤' }, ] } ] } src/menu/components/chart/antv-pie/chartcompile/index.jsx
@@ -161,7 +161,7 @@ })( <Select mode={item.multi ? 'multiple' : ''}> {item.options.map((option, index) => <Select.Option key={index} value={option.field}> <Select.Option key={index} value={option.field || option.value}> {option.label} </Select.Option> )} src/menu/components/chart/antv-pie/index.jsx
@@ -264,10 +264,16 @@ innerRadius: innerRadius, radius: innerRadius + (radius - innerRadius) / 2, }) if (plot.tooltip !== 'true') { chart.tooltip(false) } else { chart.tooltip({ showTitle: false, showMarkers: false, showMarkers: false }) } chart.legend(false) let chart1 = chart .interval() @@ -387,7 +393,11 @@ } } chart.interaction('element-highlight') if (plot.interaction && plot.interaction.length) { plot.interaction.forEach(t => { chart.interaction(t) }) } chart.render() } @@ -550,10 +560,8 @@ }) } } chart.interaction('element-active') } else { chart.axis(false) chart.interaction('element-highlight') let _chart = chart .interval() .position(`${X_axis}*${Y_axis}`) @@ -577,6 +585,12 @@ } } if (plot.interaction && plot.interaction.length) { plot.interaction.forEach(t => { chart.interaction(t) }) } chart.render() } src/menu/components/chart/antv-scatter/chartcompile/formconfig.jsx
@@ -112,6 +112,20 @@ }] }, { type: 'radio', key: 'tooltip', label: '悬浮提示', initVal: card.tooltip || 'true', required: false, options: [{ value: 'true', text: '显示' }, { value: 'false', text: '隐藏' }] }, { type: 'text', key: 'Xunit', label: 'X轴单位', @@ -132,6 +146,27 @@ initVal: card.color || 'rgba(0, 0, 0, 0.65)', tooltip: '坐标轴提示文字及示例的颜色。', required: false }, { type: 'select', key: 'interaction', label: '交互效果', initVal: card.interaction || [], multi: true, required: false, options: [ { value: 'element-active', label: '元素聚焦' }, { value: 'element-selected', label: '元素选中(多选)' }, { value: 'element-single-selected', label: '元素选中(单选)' }, // { value: 'active-region', label: '背景框' }, { value: 'view-zoom', label: '视图缩放' }, { value: 'element-highlight', label: '元素高亮' }, { value: 'element-highlight-by-color', label: '同色元素高亮' }, { value: 'element-highlight-by-x', label: '同X轴元素高亮' }, { value: 'legend-filter', label: '图例过滤' }, { value: 'legend-active', label: '图例聚焦' }, { value: 'legend-highlight', label: '图例高亮' }, { value: 'brush', label: '选框过滤' }, ] } ] } src/menu/components/chart/antv-scatter/index.jsx
@@ -207,6 +207,9 @@ itemName: { style: { fill: plot.color } } }) if (plot.tooltip !== 'true') { chart.tooltip(false) } else { chart.tooltip({ showTitle: false, showCrosshairs: true, @@ -214,6 +217,8 @@ type: 'xy', } }) } chart .point() .position('height*weight') @@ -228,7 +233,11 @@ .style({ fillOpacity: 0.85 }) chart.interaction('legend-highlight'); if (plot.interaction && plot.interaction.length) { plot.interaction.forEach(t => { chart.interaction(t) }) } chart.render() } src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -62,6 +62,7 @@ let vstFields = null if (_config.plot.datatype === 'statistics') { _config.plot.enabled = 'false' let _column = _config.columns.filter(col => _config.plot.InfoValue === col.field)[0] if (_column) { let decimal = 0 @@ -113,40 +114,109 @@ _config.plot.color = _config.plot.color || 'rgba(0, 0, 0, 0.65)' let bars = {} if (_config.plot.enabled === 'true' && _config.plot.customs && _config.plot.customs.length > 0) { let colors = new Map() let colorIndex = 0 let limit = chartColors.length let Bar_axis = [] _config.plot.customs = _config.plot.customs.map(item => { item.name = transfield[item.type] || item.type item.chartType = item.shape ? (item.shape[0] || 'bar') : 'bar' item.shape = item.shape ? (item.shape[1] || '') : '' if (_config.plot.colors && _config.plot.colors.length > 0) { if (item.chartType === 'bar') { bars[item.type] = true Bar_axis.push(item.type) } return item }) _config.plot.hasBar = Bar_axis.length > 0 if (_config.plot.mutilBar !== 'overlap') { _config.plot.Bar_axis = Bar_axis } } else { _config.plot.enabled = 'false' } let colors = new Map() if (_config.plot.colors && _config.plot.colors.length > 0) { // 颜色设置 if (_config.plot.datatype === 'statistics') { if (_config.plot.ramp === 'true') { let _s = 'l(0) ' if (_config.plot.chartType === 'bar') { _s = 'l(90) ' } _config.plot.colors.forEach(item => { if (!colors.has(item.type)) { colors.set(item.type, _s + `0:${item.color} 1:${item.color1}`) } }) } else { _config.plot.colors.forEach(item => { if (!colors.has(item.type)) { colors.set(item.type, item.color) } }) } } else if (_config.plot.enabled === 'true') { if (_config.plot.ramp === 'true') { _config.plot.colors.forEach(item => { let _type = transfield[item.type] || item.type if (!colors.has(_type)) { if (bars[item.type]) { colors.set(_type, `l(90) 0:${item.color} 1:${item.color1}` ) } else { colors.set(_type, `l(0) 0:${item.color} 1:${item.color1}` ) } } }) } else { _config.plot.colors.forEach(item => { let _type = transfield[item.type] || item.type if (!colors.has(_type)) { colors.set(_type, item.color) } }) } } else { if (_config.plot.ramp === 'true') { let _s = 'l(0) ' if (_config.plot.chartType === 'bar') { _s = 'l(90) ' } _config.plot.colors.forEach(item => { if (!transfield[item.type]) return if (!colors.has(transfield[item.type])) { colors.set(transfield[item.type], _s + `0:${item.color} 1:${item.color1}` ) } }) } else { _config.plot.colors.forEach(item => { if (!transfield[item.type]) return if (!colors.has(transfield[item.type])) { colors.set(transfield[item.type], item.color) } }) } } _config.plot.$colors = colors } if (_config.plot.enabled === 'true') { let colorIndex = 0 let limit = chartColors.length let axisIndex = 0 let hasBar = false let Bar_axis = [] let fields = [] let legends = [] _config.plot.customs.forEach(item => { item.name = transfield[item.type] || item.type item.chartType = item.shape ? (item.shape[0] || 'bar') : 'bar' item.shape = item.shape ? (item.shape[1] || '') : '' if (colors.has(item.type)) { item.color = colors.get(item.type) if (colors.has(item.name)) { item.color = colors.get(item.name) } else { item.color = chartColors[colorIndex % limit] colorIndex++ } if (item.chartType === 'bar') { hasBar = true Bar_axis.push(item.type) } if (item.axis === 'true' && axisIndex < 2) { @@ -172,16 +242,7 @@ }) _config.plot.customs = fields _config.plot.legends = legends _config.plot.hasBar = hasBar _config.plot.axisIndex = axisIndex if (_config.plot.mutilBar === 'overlap') { _config.plot.Bar_axis = [] } else { _config.plot.Bar_axis = Bar_axis } } else { _config.plot.enabled = 'false' } this.setState({ @@ -710,21 +771,11 @@ let _data = [] let _valfield = 'value' let _typefield = 'key' let colors = new Map() let colorIndex = 0 if (plot.datatype === 'statistics') { _valfield = plot.InfoValue _typefield = plot.InfoType if (plot.colors && plot.colors.length > 0) { // 颜色设置 plot.colors.forEach(item => { if (!colors.has(item.type)) { colors.set(item.type, item.color) } }) } _data = this.getStaticMsg() } else { @@ -733,14 +784,6 @@ if (plot.enabled === 'true') { this.customrender(data) return } if (plot.colors && plot.colors.length > 0) { // 颜色设置 plot.colors.forEach(item => { if (!colors.has(transfield[item.type])) { colors.set(transfield[item.type], item.color) } }) } const ds = new DataSet() @@ -838,11 +881,11 @@ } }) if (plot.colors && plot.colors.length > 0) { if (plot.$colors) { let limit = chartColors.length _chart.color(_typefield, (key) => { if (colors.has(key)) { return colors.get(key) if (plot.$colors.has(key)) { return plot.$colors.get(key) } else { colorIndex++ return chartColors[(colorIndex - 1) % limit] @@ -865,14 +908,14 @@ }) } if (plot.point === 'true' && plot.colors && plot.colors.length > 0) { if (plot.point === 'true' && plot.$colors) { let limit = chartColors.length chart .point() .position(`${plot.Xaxis}*${_valfield}`) .color(_typefield, (key) => { if (colors.has(key)) { return colors.get(key) if (plot.$colors.has(key)) { return plot.$colors.get(key) } else { colorIndex++ return chartColors[(colorIndex - 1) % limit] @@ -887,6 +930,12 @@ .color(_typefield) .size(3) .shape('circle') } if (plot.interaction && plot.interaction.length) { plot.interaction.forEach(t => { chart.interaction(t) }) } chart.render() @@ -925,7 +974,7 @@ let padding = [10, 30, 30, 30] if (!plot.Bar_axis.length) { if (!plot.Bar_axis) { if (plot.axisIndex === 2) { padding = [10, 50, 30, 50] } else if (plot.axisIndex === 1) { @@ -981,7 +1030,7 @@ nice: true }) if (plot.Bar_axis.length) { if (plot.Bar_axis) { const view1 = chart.createView({ region: { start: { x: 0, y: 0 }, @@ -1008,7 +1057,6 @@ }) view1.data(dvt.rows) view1.interaction('other-visible') view1.scale('value', { nice: true, @@ -1017,16 +1065,7 @@ view1.legend(false) let colors = new Map() let colorIndex = 0 if (plot.colors && plot.colors.length > 0) { plot.colors.forEach(item => { if (!colors.has(transfield[item.type])) { colors.set(transfield[item.type], item.color) } }) } if (plot.adjust !== 'stack') { let _chart = view1 @@ -1049,11 +1088,11 @@ } }) if (plot.colors && plot.colors.length > 0) { if (plot.$colors) { let limit = chartColors.length _chart.color('key', (key) => { if (colors.has(key)) { return colors.get(key) if (plot.$colors.has(key)) { return plot.$colors.get(key) } else { colorIndex++ return chartColors[(colorIndex - 1) % limit] @@ -1098,11 +1137,11 @@ } }) if (plot.colors && plot.colors.length > 0) { if (plot.$colors) { let limit = chartColors.length _chart.color('key', (key) => { if (colors.has(key)) { return colors.get(key) if (plot.$colors.has(key)) { return plot.$colors.get(key) } else { colorIndex++ return chartColors[(colorIndex - 1) % limit] @@ -1143,12 +1182,10 @@ }) view2.data(dv.rows) view2.interaction('other-visible') view2.legend(false) plot.customs.forEach((item, i) => { if (item.chartType === 'bar' && !plot.Bar_axis.length) { if (item.chartType === 'bar' && !plot.Bar_axis) { view2.axis(item.name, item.axis) view2.scale(item.name, { @@ -1187,7 +1224,7 @@ _chart.style({ radius: [plot.barRadius, plot.barRadius, 0, 0] }) } } else if (item.chartType === 'line') { if (!plot.Bar_axis.length) { if (!plot.Bar_axis) { view2.axis(item.name, item.axis) } else { view2.axis(item.name, { grid: null, title: null, label: null }) @@ -1233,6 +1270,14 @@ } }) if (plot.interaction && plot.interaction.length) { plot.interaction.forEach(t => { if (t === 'element-active' || t === 'element-highlight') { chart.interaction(t) } }) } chart.render() } @@ -1246,20 +1291,11 @@ let _valfield = 'value' let _typefield = 'key' let colors = new Map() let colorIndex = 0 if (plot.datatype === 'statistics') { _valfield = plot.InfoValue _typefield = plot.InfoType if (plot.colors && plot.colors.length > 0) { // 颜色设置 plot.colors.forEach(item => { if (!colors.has(item.type)) { colors.set(item.type, item.color) } }) } _data = this.getStaticMsg() } else { @@ -1268,14 +1304,6 @@ if (plot.enabled === 'true') { this.customrender(data) return } if (plot.colors && plot.colors.length > 0) { // 颜色设置 plot.colors.forEach(item => { if (!colors.has(transfield[item.type])) { colors.set(transfield[item.type], item.color) } }) } const ds = new DataSet() @@ -1389,11 +1417,11 @@ } }) if (plot.colors && plot.colors.length > 0) { if (plot.$colors) { let limit = chartColors.length _chart.color(_typefield, (key) => { if (colors.has(key)) { return colors.get(key) if (plot.$colors.has(key)) { return plot.$colors.get(key) } else { colorIndex++ return chartColors[(colorIndex - 1) % limit] @@ -1436,11 +1464,11 @@ } }) if (plot.colors && plot.colors.length > 0) { if (plot.$colors) { let limit = chartColors.length _chart.color(_typefield, (key) => { if (colors.has(key)) { return colors.get(key) if (plot.$colors.has(key)) { return plot.$colors.get(key) } else { colorIndex++ return chartColors[(colorIndex - 1) % limit] @@ -1519,6 +1547,12 @@ }) } if (plot.interaction && plot.interaction.length) { plot.interaction.forEach(t => { chart.interaction(t) }) } chart.render() } src/tabviews/custom/components/chart/antv-pie/index.jsx
@@ -726,9 +726,11 @@ }) } } chart.interaction('element-highlight') if (plot.interaction && plot.interaction.length) { plot.interaction.forEach(t => { chart.interaction(t) }) } chart.render() } @@ -902,10 +904,8 @@ }) } } chart.interaction('element-active') } else { chart.axis(false) chart.interaction('element-highlight') let _chart = chart .interval() .position(`${X_axis}*${Y_axis}`) @@ -988,7 +988,11 @@ } }) } if (plot.interaction && plot.interaction.length) { plot.interaction.forEach(t => { chart.interaction(t) }) } chart.render() } src/tabviews/custom/components/chart/antv-scatter/index.jsx
@@ -348,6 +348,9 @@ itemName: { style: { fill: plot.color } } }) if (plot.tooltip !== 'true') { chart.tooltip(false) } else { chart.tooltip({ showTitle: false, showCrosshairs: true, @@ -355,6 +358,8 @@ type: 'xy', } }) } chart .point() .position(`${plot.Xaxis}*${plot.Yaxis}`) @@ -369,7 +374,11 @@ .style({ fillOpacity: 0.85 }) chart.interaction('legend-highlight'); if (plot.interaction && plot.interaction.length) { plot.interaction.forEach(t => { chart.interaction(t) }) } chart.render() }