michelson / lazy_high_charts

Make highcharts a la ruby , works in rails 5.X / 4.X / 3.X, and other ruby web frameworks
http://www.suipit.com
MIT License
1.05k stars 242 forks source link

How to call a controller method when a bar is clicked on a chart? #243

Open antripat opened 7 years ago

antripat commented 7 years ago

Hi. I referred to your clickable bar chart wiki. The explanation does not suffice my requirement and I would need further help. My desired output Bar chart renders on the browser. User clicks a particular bar which calls a function in the controller and takes an action. I want to know how to link the controller method with the onclick event of the bar chart.

Thanks, Anant

michelson commented 7 years ago

Check the highcharts documentation , you have to implement a click handler which make an Ajax request that hits the endpoint of your action controller

Best!

El 23 sep. 2017 7:29 a. m., "antripat" notifications@github.com escribió:

Hi. I referred to your clickable bar chart wiki. The explanation does not suffice my requirement and I would need further help. My desired output Bar chart renders on the browser. User clicks a particular bar which calls a function in the controller and takes an action. I want to know how to link the controller method with the onclick event of the bar chart.

Thanks, Anant

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/michelson/lazy_high_charts/issues/243, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAuyM0ZaOiM5JuNKGfxBDUUagAuWmgQks5slN2KgaJpZM4Phgzu .