echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Feature] Unable to show tooltip for the `title` if the title name is too long

Open deb523 opened this issue 1 year ago • 2 comments

What problem does this feature solve?

If the title is too long, it overlaps on the gauge and doesn't look good.

What does the proposed API look like?

title: {
offsetCenter: [
.
.
],
.
overflow: 'truncate',
tooltip: {
    position: , 
    formatter: ,
    .
    .
 }
}

UX:

Need a tooltip on hover of Total People... so that the entire text could be shown to the end user.

Screenshot 2024-06-21 at 6 31 52 PM


PS, would be following up from my personal Github as well: https://github.com/debnathSD

deb523 avatar Jun 21 '24 13:06 deb523

I don't think there is a tooltip for the title. The only tooltip is for the pointer - Demo.

helgasoft avatar Jun 25 '24 01:06 helgasoft

I don't think there is a tooltip for the title. The only tooltip is for the pointer - Demo.

Understood.

I have implemented the same for pointer but I was just wondering whether it could be implemented / added as a new feature for the title as well - as there could be titles (having this use case) which are lengthy.

deb523 avatar Jun 25 '24 14:06 deb523

@deb523 I'm not sure if showing a tooltip on the title is common, but it should be able to be implemented like the legend component. If you think it is worth and you are interested in this feature, feel free to open a PR.

And this might be similar to #16315. The feature should allow the developer to detect if the text is overflow and decide whether to show the tooltip and the content to show.

plainheart avatar Jul 01 '24 04:07 plainheart