Open leoplaw opened 2 years ago
tool-selected
event returns the originating tool which emitted the event.
object-selected
does not.
On the object-selected
event, the chart.data.selected
is not populated, so the following is not possible: this.chart.get(this.chart.data.selected)
So far the method that does work is to use a watcher.
'chart.data.selected': function(newValue, oldValue) {
if (newValue) {
console.log("TVJS: selected:",newValue)
const selected = this.chart.get(newValue)
console.log("TVJS: Object Selected:",selected)
}
}
https://github.com/tvjsx/trading-vue-js/blob/e881bdb5c3ec3b890d21e3059cb6b3ef85a47432/src/components/primitives/pin.js#L157
Event
object-selected
should return the object so listener can identify which object emitted it.I tried hacking this into the code, but it does not seem to work. So perhaps it is the wrong place?