I have the following code (using the chartkick gem):
<%= pie_chart [[t('result.positive'), @rating_positive], [t('result.negative'), @rating_negative], [t('result.neutral'), @rating_neutral]],
colors: ['#B3D986', '#E04848', '#C9C9C9'],
library: {
chart: {
backgroundColor: '#EEEEEE',
width: 300,
height: 250
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true,
events: {
click: function(event, i) {
alert("test");
}
}
}
}
}
%>
I just want to pas the click event function as a parameter, but rails interprets it. html_safe
and helper functions are of no use. Suggestions?