mirror of
https://github.com/dataease/dataease.git
synced 2026-06-17 21:08:31 +08:00
fix(图表): 修复热力图拖动legend之后最值色块概率消失
This commit is contained in:
@@ -242,8 +242,13 @@ export class TableG2Chart extends G2ChartView {
|
||||
scale: {
|
||||
color: {
|
||||
type: 'linear',
|
||||
nice: true,
|
||||
interpolate() {
|
||||
return c => colors[Math.floor(c * (colors.length - 1))]
|
||||
return c => {
|
||||
if (isNaN(c)) return colors[0]
|
||||
const t = Math.max(0, Math.min(1, c))
|
||||
return colors[Math.floor(t * (colors.length - 1))]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -272,8 +277,7 @@ export class TableG2Chart extends G2ChartView {
|
||||
legend: {
|
||||
color: {
|
||||
color: colors,
|
||||
label: false,
|
||||
step: 0.00000001
|
||||
label: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user