Skip to content

Commit

Permalink
Cleaned up rendering for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
kmwhite committed Apr 21, 2012
1 parent 5437ecc commit e96c710
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions lib/redmon/public/redmon.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,38 @@ var Redmon = (function() {
function render(data) {
// setup plot
var options = {
series: { shadowSize: 0 },
yaxis: { show: true },
xaxis: { show: true }
series: {
shadowSize: 3
},
yaxis: {
show: true
},
xaxis: {
mode: 'time',
show: true
},
grid: {
backgroundColor: {
colors: ["#ddd", "#fff"]
},
hoverable: true,
clickable: true
}
};

var maxItems = 300;

var old_data = points(data);

var plot = $.plot($("#memory-container"), [points(data)], options);

function onData(ev, data) {
if (data) {
if (data.length > 0)
data = data.slice(1);

old_data = old_data.concat(points([data]));
old_data = old_data.slice(1).concat(points([data]));

plot.setData([old_data]);
console.log(old_data.length);
plot.setupGrid();
plot.draw();

Expand Down

0 comments on commit e96c710

Please sign in to comment.