fix the shift and width of stat highchart

This commit is contained in:
Stephen Birarda 2015-04-30 08:33:08 -07:00
parent 17c5d1e32a
commit 73da4828b1
2 changed files with 8 additions and 2 deletions

View file

@ -82,3 +82,7 @@ tr.new-row {
color: #3c763d;
background-color: #dff0d8;
}
.highchart-modal .modal-dialog {
width: 650px;
}

View file

@ -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: "<div id='highchart-container'></div>",
buttons: {}
buttons: {},
className: 'highchart-modal'
});
currentHighchart = new Highcharts.Chart({