Skip to content

Commit 684a97e

Browse files
committed
fix(bullet): axis-trigger tooltip with full breakdown, no draw-in animation
Hovering the thin bar precisely was the only way to see the range labels; the tooltip now triggers on the axis so hovering anywhere shows the measure, labeled ranges, markers and marker lines together. Control changes no longer animate elements in from the bottom. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 72ec091 commit 684a97e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

superset-frontend/plugins/plugin-chart-echarts/src/Bullet/transformProps.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export default function transformProps(
112112
.map(({ value, label }) => `${label}: \u2264 ${formatter(value)}`);
113113

114114
const echartOptions: EChartsCoreOption = {
115+
animation: false,
115116
// A single-measure chart needs no legend; the default one collides
116117
// with the x-axis labels.
117118
legend: { show: false },
@@ -139,13 +140,24 @@ export default function transformProps(
139140
axisTick: { show: false },
140141
axisLabel: { show: false },
141142
},
143+
// Axis trigger so hovering anywhere on the chart shows the breakdown;
144+
// precise hovers on the thin bar or bands are hard to hit.
142145
tooltip: {
143146
confine: true,
147+
trigger: 'axis',
144148
formatter: () =>
145149
sanitizeHtml(
146150
[
147151
`${metricLabel}: <b>${formatter(measure)}</b>`,
148152
...rangeTooltipLines,
153+
...markers.map(
154+
(value, i) =>
155+
`${markerLabelAt(i, markerLabels, markers)}: <b>${formatter(value)}</b>`,
156+
),
157+
...markerLines.map(
158+
(value, i) =>
159+
`${markerLabelAt(i, markerLineLabels, markerLines)}: <b>${formatter(value)}</b>`,
160+
),
149161
].join('<br />'),
150162
),
151163
},

0 commit comments

Comments
 (0)