散点图加颜色轴和点大小控制
This commit is contained in:
parent
78337da23b
commit
3d83bea8a8
|
@ -521,11 +521,28 @@ export default {
|
||||||
},
|
},
|
||||||
// 构造scatter列表
|
// 构造scatter列表
|
||||||
buildScatterList() {
|
buildScatterList() {
|
||||||
|
console.log(this.twoDOption)
|
||||||
const {
|
const {
|
||||||
xAxis: { min: minX, max: maxX },
|
xAxis: { min: minX, max: maxX },
|
||||||
yAxis: { min: minY, max: maxY },
|
yAxis: { min: minY, max: maxY },
|
||||||
} = this.twoDOption
|
} = this.twoDOption
|
||||||
|
|
||||||
|
//点大小
|
||||||
|
this.twoDOption.series[0].symbolSize = 5
|
||||||
|
//
|
||||||
|
this.twoDOption.visualMap = {
|
||||||
|
min: 512,
|
||||||
|
max: minY,
|
||||||
|
dimension: 1,
|
||||||
|
orient: 'vertical',
|
||||||
|
right: 10,
|
||||||
|
top: 'center',
|
||||||
|
text: ['HIGH', 'LOW'],
|
||||||
|
calculable: true,
|
||||||
|
inRange: {
|
||||||
|
color: ['#ffffff', '#ff0000']
|
||||||
|
}
|
||||||
|
},
|
||||||
this.twoDOption.series[0].data = this.histogramDataList
|
this.twoDOption.series[0].data = this.histogramDataList
|
||||||
.filter(({ b, g, c }) => c && b >= minX && b <= maxX && g >= minY && g <= maxY)
|
.filter(({ b, g, c }) => c && b >= minX && b <= maxX && g >= minY && g <= maxY)
|
||||||
.map(({ b, g, c }) => this.buildScatterItem(b, g, c))
|
.map(({ b, g, c }) => this.buildScatterItem(b, g, c))
|
||||||
|
@ -536,9 +553,9 @@ export default {
|
||||||
const { r, g, b } = this.interpolateColor(1 - count / this.currCount)
|
const { r, g, b } = this.interpolateColor(1 - count / this.currCount)
|
||||||
return {
|
return {
|
||||||
value: [xAxis, yAxis],
|
value: [xAxis, yAxis],
|
||||||
itemStyle: {
|
// itemStyle: {
|
||||||
color: `rgb(${r}, ${g}, ${b})`,
|
// color: `rgb(${r}, ${g}, ${b})`,
|
||||||
},
|
// },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 重绘矩形框区域
|
// 重绘矩形框区域
|
||||||
|
|
Loading…
Reference in New Issue
Block a user