I spent a lot of time trying to figure it out myself. Unfortunately, there seems to be no easy option to “add a link here and go.”
Chartkick , Google Highcharts. , 'click' /. , , JQuery/JS, - , , .
HighCharts :
http://api.highcharts.com/highcharts#plotOptions.pie.events.click
, , JS/Jquery ( Coffescript http://js2.coffee)
http://birdchan.com/home/2012/09/07/highcharts-pie-charts-can-have-url-links/
, , , , , :
data: [
{name: 'Not Tested', color: '#FFA850', y: 87, url: 'http://my_site1.com'},
{name: 'Fail', color: '#FF2929', y: 2, url: 'http://my_site2.com'},
{name: 'Pass', color: '#31FF4F', y: 32, url: 'http://my_site3.com'}
]
- :
$.ajax {
url: "/place/resources/resource_id/top_members.json"
success: (data) ->
draw_some_pie_chart(data)
}
GON gem, Coffeescript/JS.
, / . , ,