散点图加颜色轴和点大小控制

This commit is contained in:
surida 2024-07-16 10:35:10 +08:00
parent 78337da23b
commit 3d83bea8a8

View File

@ -521,11 +521,28 @@ export default {
},
// scatter
buildScatterList() {
console.log(this.twoDOption)
const {
xAxis: { min: minX, max: maxX },
yAxis: { min: minY, max: maxY },
} = 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
.filter(({ b, g, c }) => c && b >= minX && b <= maxX && g >= minY && g <= maxY)
.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)
return {
value: [xAxis, yAxis],
itemStyle: {
color: `rgb(${r}, ${g}, ${b})`,
},
// itemStyle: {
// color: `rgb(${r}, ${g}, ${b})`,
// },
}
},
//