feat: 散点图增加辅助线

This commit is contained in:
ulleo 2023-12-29 15:00:18 +08:00
parent 1a30b2e8fe
commit 3e164dfa79
3 changed files with 7 additions and 5 deletions

View File

@ -267,7 +267,7 @@ const hexToRgba = (hex, opacity) => {
}
export function seniorCfg(chart_option, chart) {
if (chart.senior && chart.type && (chart.type.includes('bar') || chart.type.includes('line') || chart.type.includes('mix'))) {
if (chart.senior && chart.type && (chart.type.includes('bar') || chart.type.includes('line') || chart.type.includes('mix') || chart.type.includes('scatter'))) {
const senior = JSON.parse(chart.senior)
if (senior.functionCfg) {
if (senior.functionCfg.sliderShow) {

View File

@ -1043,7 +1043,7 @@ export function getSlider(chart) {
export function getAnalyse(chart) {
let senior = {}
const assistLine = []
if (chart.senior && chart.type && (chart.type.includes('bar') || chart.type.includes('line') || chart.type.includes('mix') || chart.type.includes('area'))) {
if (chart.senior && chart.type && (chart.type.includes('bar') || chart.type.includes('line') || chart.type.includes('mix') || chart.type.includes('area') || chart.type.includes('scatter'))) {
senior = JSON.parse(chart.senior)
if (senior.assistLine && senior.assistLine.length > 0) {
const customStyle = JSON.parse(chart.customStyle)

View File

@ -2106,7 +2106,8 @@ export default {
},
showCfg() {
return includesAny(this.view.type, 'bar', 'line', 'area', 'gauge', 'table', 'liquid') && this.view.type !== 'race-bar' ||
equalsAny(this.view.type, 'text', 'label', 'map', 'buddle-map') || this.view.render === 'echarts' && includesAny(this.view.type, 'mix')
equalsAny(this.view.type, 'text', 'label', 'map', 'buddle-map') || this.view.render === 'echarts' && includesAny(this.view.type, 'mix') ||
this.view.type === 'scatter'
},
showSeniorCfg() {
return includesAny(this.view.type, 'bar', 'line', 'area', 'table') ||
@ -2125,10 +2126,11 @@ export default {
}
return includesAny(this.view.type, 'bar', 'line', 'area', 'gauge', 'liquid') ||
equalsAny(this.view.type, 'text', 'label') ||
(this.view.render === 'antv' && this.view.type.includes('table')) || this.view.render === 'echarts' && includesAny(this.view.type, 'mix')
(this.view.render === 'antv' && this.view.type.includes('table')) || this.view.render === 'echarts' && includesAny(this.view.type, 'mix') ||
this.view.type === 'scatter'
},
showAssistLineCfg() {
return includesAny(this.view.type, 'bar', 'line', 'area', 'mix')
return includesAny(this.view.type, 'bar', 'line', 'area', 'mix') || this.view.type === 'scatter'
},
showThresholdCfg() {
if (this.view.type === 'bidirectional-bar') {