diff --git a/modules/mining-checker/assets/js/app.js b/modules/mining-checker/assets/js/app.js index 993e3e7..c5098de 100644 --- a/modules/mining-checker/assets/js/app.js +++ b/modules/mining-checker/assets/js/app.js @@ -438,6 +438,11 @@ } function SimpleChart(props) { + function pointTooltip(seriesLabel, point) { + const label = seriesLabel ? `${seriesLabel} ยท ` : ''; + return `${label}${String(point.x)}: ${fmtNumber(point.y, 6)}`; + } + const series = Array.isArray(props.series) ? props.series .map((item, index) => ({ @@ -529,7 +534,9 @@ height: height - padding - coord[1], rx: 8, fill: 'rgba(59, 130, 246, 0.75)', - }); + }, [ + h('title', { key: 'title' }, pointTooltip(seriesCoords[0].label, seriesCoords[0].data[index])), + ]); })) : h('g', { key: 'series' }, seriesCoords.flatMap((item, index) => { const nodes = []; @@ -557,7 +564,9 @@ fill: '#f8fafc', stroke: item.color, strokeWidth: 2, - })))); + }, [ + h('title', { key: 'title' }, pointTooltip(item.label, item.data[pointIndex])), + ])))); return nodes; })), ]),