working on new chart for PTO

This commit is contained in:
Ken Johnson
2013-05-28 10:12:31 -04:00
parent 9feae35f5f
commit 657db353c4
2 changed files with 12 additions and 9 deletions
+8
View File
@@ -3,4 +3,12 @@ class PaidTimeOff < ActiveRecord::Base
belongs_to :user belongs_to :user
has_one :schedule, :foreign_key => :user_id, :primary_key => :user_id has_one :schedule, :foreign_key => :user_id, :primary_key => :user_id
def sick_days_remaining
self.sick_days_earned - self.sick_days_taken
end
def pto_days_reamining
self.pto_earned - self.pto_taken
end
end end
+4 -9
View File
@@ -38,7 +38,7 @@
<div class="widget"> <div class="widget">
<div class="widget-header"> <div class="widget-header">
<div class="title"> <div class="title">
<span class="fs1" aria-hidden="true" data-icon="&#xe097;"></span> Column Chart <span class="fs1" aria-hidden="true" data-icon="&#xe097;"></span> Sick Days
</div> </div>
</div> </div>
<div class="widget-body"> <div class="widget-body">
@@ -72,19 +72,14 @@ $('.date_picker').daterangepicker({
function drawChart3() { function drawChart3() {
var data = google.visualization.arrayToDataTable([ var data = google.visualization.arrayToDataTable([
['Year', 'Visitors', 'Orders', 'Income', 'Expenses'], ['Current Date', 'Days Earned', 'Days Taken', 'Days Remaining'],
['2007', 300, 800, 900, 300], [ <%= "As of today: #{Date.today}".inspect.html_safe %>, <%= @pto.sick_days_earned %>, <%= @pto.sick_days_taken %>, <%= @pto.sick_days_remaining %> ], ]);
['2008', 1170, 860, 1220, 564],
['2009', 260, 1120, 2870, 2340],
['2010', 1030, 540, 3430, 1200],
['2011', 200, 700, 1700, 770],
['2012', 1170, 2160, 3920, 800], ]);
var options = { var options = {
width: 'auto', width: 'auto',
height: '160', height: '160',
backgroundColor: 'transparent', backgroundColor: 'transparent',
colors: ['#b5799e', '#579da9', '#e26666', '#1e825e', '#dba26b'], colors: ['#579da9', '#e26666', '#1e825e'],
tooltip: { tooltip: {
textStyle: { textStyle: {
color: '#666666', color: '#666666',