Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自定义tooltip的itemTpl,如何复用marker #4036

Closed
oneplusonecy opened this issue Jul 13, 2022 · 1 comment
Closed

自定义tooltip的itemTpl,如何复用marker #4036

oneplusonecy opened this issue Jul 13, 2022 · 1 comment

Comments

@oneplusonecy
Copy link

想在tooltip时候显示单位 KM ,但是如何复用原有的marker
chart.tooltip({ showTitle: false, itemTpl:



  • {name}:{value}KM
  • })

    @hustcc
    Copy link
    Member

    hustcc commented Sep 13, 2022

    给你一个参考示例,当前是要有 dom 在,应该是自动保留的,当然目前确实不是很好用。

    chart.tooltip({
      showTitle: false,
      showMarkers: false,
      itemTpl: '<li class="g2-tooltip-list-item" data-index={index}>'
        + '<span style="background-color:{color};" class="g2-tooltip-marker"></span>'
        + '{name}{value}</li>'
    });

    @hustcc hustcc closed this as completed Sep 13, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants