Skip to content

[Feature] valueFormatter 回调函数的参数增加 dataIndex #18997

Closed

Description

@aqnghu

What problem does this feature solve?

tooltip. valueFormatter 的回调函数 (value: number | string) => string 只能获取数据,无法获取该数据的其他关联信息,希望能增加dataIndex 参数

What does the proposed API look like?

增加回调函数参数 (value: number | string, dataIndex: number) => string

Activity

  1. added
    pending
    on Aug 16, 2023
  2. echarts-bot commented on Aug 16, 2023

    @echarts-bot

    @aqnghu It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

    TRANSLATED

    TITLE

    [Feature] Add dataIndex to the parameter of valueFormatter callback function

    BODY

    What problem does this feature solve?

    `tooltip. valueFormatter' callback function '(value: number | string) => string ' can only get data, can not get other related information of the data, hope to increase the dataIndex parameter

    What does the proposed API look like?

    Add callback function parameter '(value: number | string, dataIndex: number) => string '

  3. theDoinb commented on Aug 25, 2023

    @theDoinb

    dataIndex 是确是有用的, 例如我的图表只想体现变换率,同时想在tooltip展示原值,我就可以用dataIndex去取值并格式化,如果同时展示两组数据的话,变化率很小,原值却很大,会导致 Y 轴的最大值并不是我所期望的。

  4. ChepteaCatalin commented on Sep 17, 2023

    @ChepteaCatalin
    Contributor

    I'm interested in fixing this issue.

  5. added a commit that references this issue on Sep 26, 2023
    80b251f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    new-featurependingtopic: tooltip

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions