From 73da4828b1d78a213ff799eceb3aea389eaba50a Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 30 Apr 2015 08:33:08 -0700 Subject: [PATCH] fix the shift and width of stat highchart --- domain-server/resources/web/css/style.css | 4 ++++ domain-server/resources/web/stats/js/stats.js | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/domain-server/resources/web/css/style.css b/domain-server/resources/web/css/style.css index 66fc2937a1..e025e491d4 100644 --- a/domain-server/resources/web/css/style.css +++ b/domain-server/resources/web/css/style.css @@ -82,3 +82,7 @@ tr.new-row { color: #3c763d; background-color: #dff0d8; } + +.highchart-modal .modal-dialog { + width: 650px; +} diff --git a/domain-server/resources/web/stats/js/stats.js b/domain-server/resources/web/stats/js/stats.js index 33305b34b7..e5f55b4457 100644 --- a/domain-server/resources/web/stats/js/stats.js +++ b/domain-server/resources/web/stats/js/stats.js @@ -29,7 +29,8 @@ $(document).ready(function(){ // get the last value using underscore-keypath var y = _(json).valueForKeyPath(graphKeypath); - var shift = currentHighchart.series[0].length > 20; + // start shifting the chart once we hit 20 data points + var shift = currentHighchart.series[0].data.length > 20; currentHighchart.series[0].addPoint([x, y], true, shift); } }).fail(function(data) { @@ -58,7 +59,8 @@ $(document).ready(function(){ bootbox.dialog({ title: graphKeypath, message: "
", - buttons: {} + buttons: {}, + className: 'highchart-modal' }); currentHighchart = new Highcharts.Chart({