dark flots

This commit is contained in:
Yann Esposito 2015-03-23 18:05:51 +01:00
parent 9ab2b1264d
commit a67e319b0e

View file

@ -1,5 +1,5 @@
(function() {
// Reify a timeseries view from JSON
// Reify a timeseries view from JSON
var FlotView = function(json) {
// Extract state from JSON
view.View.call(this, json);
@ -11,7 +11,7 @@
this.stackMode = json.stackMode || 'false';
this.lineWidth = json.lineWidth || 1;
this.timeRange = (json.timeRange * 1000) || 300000;
this.font = {
size: 11,
lineheight: 13,
@ -42,10 +42,10 @@
// Time series state
this.series = {};
this.data = [];
if (!json.virtual) {
this.reflow();
// Initialize graph
this.setupGraph(new Date());
@ -89,15 +89,14 @@
},
grid: {
borderWidth: 1,
borderColor: "#aaa",
color: "#444",
backgroundColor: '#fff'
borderColor: "#073642",
color: "#586e75",
},
yaxis: {
font: this.font,
min: this.min,
max: this.max
},
},
xaxis: {
font: this.font,
mode: "time",
@ -121,7 +120,7 @@
this.graph.draw();
}
// Re-order the data list and series index to be in sorted order by label.
// Re-order the data list and series index to be in sorted order by label.
FlotView.prototype.resortSeries = function() {
// Shorten labels
var hostPrefix = strings.commonPrefix(_.pluck(this.data, 'riemannHost'));
@ -191,14 +190,14 @@
}
var series = this.data[this.series[key]].data;
// Add event to series
if (event.state === "expired") {
series.push(null);
} else if (event.metric !== undefined) {
series.push([event.time, event.metric]);
}
this.setGraphData();
};
@ -281,7 +280,7 @@
return editTemplate(this);
};
// Redraws graph
// Redraws graph
FlotView.prototype.refresh = function() {
this.graph.setupGrid();
this.graph.draw();