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

feat: update IndicatorTooltipView to Added feature event ability to return indicatorId #657

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bandaralsehli
Copy link

all icon events return in "ClickEvent" icon only return data like this {paneId,indicatorName,iconId}
the problem is if two indicators have the same name the change of "visible" or "calcParams" changes all two indicators because "overrideIndicator" uses only data returned by event {paneId,indicatorName,iconId}

Added feature event ability to return indicatorId.

Added feature event ability to return indicatorId.
@thichmautim
Copy link

thichmautim commented Feb 25, 2025

If your code decides to use multiple indicators with the same name, you should store the indicatorId when calling the createIndicator function and use it later to update the indicator through the overrideIndicator function.

https://klinecharts.com/en-US/api/instance/createIndicator --> return indicatorId
https://klinecharts.com/en-US/api/instance/overrideIndicator ->

(
  indicator: {
    id?: string // <~~~ Change here
    ...
  }
) => void

@bandaralsehli
Copy link
Author

the problem is (property) in file [IndicatorTooltipView.ts]
EventHandler.mouseClickEvent?: MouseTouchEventCallback | undefined is mouseClickEvent: this._boundIconClickEvent({ paneId, indicatorName, iconId: icon.id }),
We need to return the indicatorId if we click any icons in TooltipIconClick ( visible, invisible, setting, close ).
It is a feature we can add to the ability.

Please correct me if I made a mistake in my written English.

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

Successfully merging this pull request may close these issues.

2 participants