I'm using AmStockChart to show usual line graphs. I'm trying to attach Click events to each bullet on the graph but it produces no result. The other events works, but not the Click.

For example if I do:

...
chart.addListener('zoomed', chartClick);
...
function chartClick () {
    console.log("Zoomed!");
}

it works if I resize the graph. But if I change it to:

...
chart.addListener('clickStockEvent', chartClick);
...
function chartClick () {
    console.log("Clicked!");
}

it doesn't react on any click neither on bullet nor anywhere else. Here is the jsfiddle (addListener is at the buttom)

有帮助吗?

解决方案

Do you actually have stock events on the chart? as If you have simple bullets, not events, then you should use clickGraphItem event instead of clickStockEvent.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top