Skip to content

Instantly share code, notes, and snippets.

@SkyKOG
Created March 29, 2013 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SkyKOG/5270711 to your computer and use it in GitHub Desktop.
Save SkyKOG/5270711 to your computer and use it in GitHub Desktop.
Still the prob ...
<div class="row">
<div class="span4">
<table class="table table-bordered">
<thead>
<tr>
<th>Specialization</th>
<th>Number of Employees</th>
</tr>
</thead>
<tbody>
<% @emp_spec_views.each do |emp_spec_view| %>
<tr>
<td><%= emp_spec_view.specialization_name %></td>
<td><%= emp_spec_view.number_of_employees %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="span8">
</div>
</div>
<script>
window.onload = function () {
Morris.Bar({
element: 'genders_chart',
data: $(&quot;#genders_chart&quot;).data(&quot;emp_spec_views&quot;),
xkey: 'specialization_name',
ykeys: ['number_of_employees'],
labels: ['Number Of Employees'],
hideHover: 'true',
barColors: function (row, series, type) {
if (type === 'bar') {
var blue = Math.floor(255 * row.y / this.ymax);
return 'rgb(' + blue + ',0,0)';
}
else {
return '#000';
}
}
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment