diff --git a/app/assets/javascripts/exercise_graphs.js b/app/assets/javascripts/exercise_graphs.js index f0a9f0fc..8b11f668 100644 --- a/app/assets/javascripts/exercise_graphs.js +++ b/app/assets/javascripts/exercise_graphs.js @@ -78,8 +78,8 @@ $(function() { function graph_assesses() { // MAKE THE GRAPH var width_ratio = .8; - if (width_ratio > 1000){ - width_ratio = 1000; + if (getWidth()*width_ratio > 1000){ + width_ratio = 1000/getWidth(); } var height_ratio = .7; // percent of height diff --git a/app/assets/javascripts/working_time_graphs.js b/app/assets/javascripts/working_time_graphs.js index 4b6db432..181b3799 100644 --- a/app/assets/javascripts/working_time_graphs.js +++ b/app/assets/javascripts/working_time_graphs.js @@ -67,8 +67,8 @@ $(function() { // DRAW THE LINE GRAPH ------------------------------------------------------------------------------ function draw_line_graph() { var width_ratio = .8; - if (width_ratio > 1000){ - width_ratio = 1000; + if (getWidth()*width_ratio > 1000){ + width_ratio = 1000/getWidth(); } var height_ratio = .7; // percent of height