highchart code add by self
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<%= wicked_pdf_javascript_include_tag 'jquery-1.6.2.min', 'dr_statistics/highcharts' %>
<script>
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
first_name: {
text: 'Monthly Average Rainfall'
},
last_name: {
text: 'Source: WorldClimate.com'
},
xAxis: {
students: [
'first_name',
'last_name'
]
},
yAxis: {
min: 0,
title: {
text: 'Rainfall (mm)
'
}
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
'<td style="padding:0"><b>{point.y:.1f} mm</b></td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0,
enableMouseTracking: false,
shadow: false,
animation: false }
},
series:[
<%@students.each do |op|%>
{
first_name:'<%= op.first_name%>',
data:[<%= Student.count%>]
},
<% end %>
]
});
});
</script>
series: [{
name: 'Amount',
data: []
}]
Comments
Post a Comment