diff --git a/packages/view/src/components/Statistics/AuthorBarChart/AuthorBarChart.tsx b/packages/view/src/components/Statistics/AuthorBarChart/AuthorBarChart.tsx index b11a8890..b1aae6d9 100644 --- a/packages/view/src/components/Statistics/AuthorBarChart/AuthorBarChart.tsx +++ b/packages/view/src/components/Statistics/AuthorBarChart/AuthorBarChart.tsx @@ -78,13 +78,11 @@ const AuthorBarChart = () => { .text(`${metric} # / Total ${metric} # (%)`); // Event handler - const handleMouseOver = () => { - tooltip.style("display", "inline-block"); - }; - const handleMouseMove = (e: MouseEvent, d: AuthorDataType) => { + const handleMouseOver = (e: MouseEvent, d: AuthorDataType) => { tooltip + .style("display", "inline-block") .style("left", `${e.pageX - 70}px`) - .style("top", `${e.pageY - 70}px`) + .style("top", `${e.pageY - 90}px`) .html( `

${d.name}

${metric}: @@ -96,6 +94,10 @@ const AuthorBarChart = () => {

` ); }; + + const handleMouseMove = (e: MouseEvent) => { + tooltip.style("left", `${e.pageX - 70}px`).style("top", `${e.pageY - 90}px`); + }; const handleMouseOut = () => { tooltip.style("display", "none"); };