You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of now the tooltip can be customized, but right now the tooltip moves around the height of bar. Can we have the tooltip visible at top of the individual bar?
I have looked for the custom bar component as well, but it uses the showTooltip method that always works with the mousemove event.
Requirements in my project are-
Showing tooltip at the top of bars
By default showing a tooltip for the last bar
Need not to hide tooltip for last visited bar
Please let me know if there is any workaround available. Thanks!
Although I tried to achieve the same, but no luck in achieving it perfectly-
const CustomBarComponent = (barProps) => {
const { x, y, width, height, color, data, showTooltip, borderRadius } = barProps
// By default showing a tooltip for the last bar
useEffect(() => {
if (data.index === 59 && props.selectedBarIndex === data.index) {
showTooltip(<ToolTipElement data={data.data} index={data.index} />, event)
// Here it needs the event to show tooltip by default at last element
}
}, [])
return (
<g
transform={`translate(${x}, ${y})`}
onMouseEnter={(event) => {
props.updateBarIndex(data.index)
showTooltip(<ToolTipElement data={data.data} index={data.index} />, event)
}}
onMouseMove={(event): void => showTooltip(<ToolTipElement data={data.data} />, event)}
>
<rect width={width} height={height} fill={color} strokeWidth="0" rx={borderRadius} />
</g>
)
}
In the above code not doing anything on mouseleave event, hence the tooltip for last visited bar stay visible.
This discussion was converted from issue #1681 on July 13, 2021 12:29.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
As of now the tooltip can be customized, but right now the tooltip moves around the height of bar. Can we have the tooltip visible at top of the individual bar?
I have looked for the custom bar component as well, but it uses the showTooltip method that always works with the mousemove event.
Requirements in my project are-
Please let me know if there is any workaround available. Thanks!
Although I tried to achieve the same, but no luck in achieving it perfectly-
In the above code not doing anything on mouseleave event, hence the tooltip for last visited bar stay visible.
Beta Was this translation helpful? Give feedback.
All reactions