简体   繁体   中英

AmCharts serial chart trend-line click

I am using javascript amcharts v3 to generate trend like interface element. I use trendline class to create trend lines that mark certain events. I would like to handle trendline click event but there seems to be no way of doing it.

Has anyone come across this type of problem or do you have any idea how to work around this?

For trend line example I use this page. There is jsfiddle link in it.

Thank you for the time you spend reading my question.

Edit: JSfiddle example - > here

Not the most elegant solution (ie it uses the generated content rather than hooking neatly into the framework), but I have done the following to catch a click event.

$('#chartdiv').on('click', 'svg path[fill="#00CC00"]', function(){alert('hello');})

Which will bind a click to the chartdiv and then filter on all svg path objects that are the colour of the trendline, triggering the code if it matches.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM