Closed FairyWorld closed 1 year ago
If you are using the latest release (v4.0) then please be aware of this breaking change: https://tradingview.github.io/lightweight-charts/docs/migrations/from-v3-to-v4#mouseeventparams-field-hoveredmarkerid-was-renamed-to-hoveredobjectid
MouseEventParams
field hoveredMarkerId
was renamed to hoveredObjectId
If this does not resolve your issue then could you please provide the following:
Related: #1267
如果您使用的是最新版本 (v4.0),请注意以下重大更改:tradingview.github.io/lightweight-charts/docs/migrations/from-v3-to-v4#mouseeventparams-field-hoveredmarkerid-was-renamed-to-hoveredobjectid
MouseEventParams
字段已重命名为hoveredMarkerId``hoveredObjectId
如果这不能解决您的问题,那么您能否提供以下内容:
- 您正在使用的版本
- 重现步骤
- 一个简单的例子(jsFiddle或类似的东西)。
相关: #1267
The version I am using has been upgraded to v4.0.0
Here are some issues I'm having
const markers = [
{
id: "mark1",
time: candleStickData[10].time,
position: "aboveBar",
color: "#e91e63",
shape: "circle",
text: "mark1",
size: 2,
}
];
series.setMarkers(markers);
chart.subscribeClick((param) => { if (param.hoveredObjectId) { alert("click marker"); } });
When I tested this further, it looks like the hit box for the text of marker is incorrectly shifted to the right (as if the text wasn't adjusted to be centred).
Example: https://glitch.com/edit/#!/generated-fir-pomegranate
When subscribeClick is triggered by the text in the markers, the howeredMarkerId cannot be obtained. Now I have a requirement to click both the marker and the marker text to perform the processing I need to perform