Console graph color scheme support (#2900)

Add a colorScheme parameter to PromConsole.Graph, to allow using custom colors in console graphs.
pull/2902/head
Alin Sinpalean 9 years ago committed by Brian Brazil
parent 43075d0215
commit 38de290d5f
  1. 80
      web/ui/bindata.go
  2. 5
      web/ui/static/js/prom_console.js

File diff suppressed because one or more lines are too long

@ -311,6 +311,9 @@ PromConsole.graphDefaults = {
yAxisFormatter: PromConsole.NumberFormatter.humanize,
// Number formatter for y values hover detail.
yHoverFormatter: PromConsole.NumberFormatter.humanizeExact,
// Color scheme to be used by the plots. Can be either a list of hex color
// codes or one of the color scheme names supported by Rickshaw.
colorScheme: null,
};
PromConsole.Graph = function(params) {
@ -420,7 +423,7 @@ PromConsole.Graph.prototype._escapeHTML = function(string) {
PromConsole.Graph.prototype._render = function(data) {
var self = this;
var palette = new Rickshaw.Color.Palette();
var palette = new Rickshaw.Color.Palette({scheme: this.params.colorScheme});
var series = [];
// This will be used on resize.

Loading…
Cancel
Save