Skip to content

[Feature] relative length units in the tooltip #18253

@sirAbramstone

Description

@sirAbramstone

What problem does this feature solve?

In our low-code platform we allow users to set relative length units (such as rem & em) for any component of a chart (Legend, Axis, etc) - mostly for options that set font size. In previous major version of echarts we've been reached this with some tricky hacks with DOM, because, as we know, echarts allows us to use only numbers. But not so long ago we upgraded to version 5 and recently I noticed that now we can use relative units without any hacks as-is (btw, you didn't mention that in the official documentation). And then I found that we can do that in any component, except Tooltip. Tooltip just gets our relative units and concats them with "px" string. And we've been compelled to return to old tricks with DOM.

What does the proposed API look like?

Can we expect Tooltip to support relative length units? AFAIC all that need to do - tests given value and concat it with "px", like you do before, if it is number, and do nothing if it is string with some units.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enThis issue is in Englishnew-featurependingWe are not sure about whether this is a bug/new feature.staleInactive for a long time. Will be closed in 7 days.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions