mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Console graph color scheme support (#2900)
Add a colorScheme parameter to PromConsole.Graph, to allow using custom colors in console graphs.
This commit is contained in:
parent
43075d0215
commit
38de290d5f
File diff suppressed because one or more lines are too long
|
@ -311,6 +311,9 @@ PromConsole.graphDefaults = {
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
// Number formatter for y values hover detail.
|
// Number formatter for y values hover detail.
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanizeExact,
|
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) {
|
PromConsole.Graph = function(params) {
|
||||||
|
@ -420,7 +423,7 @@ PromConsole.Graph.prototype._escapeHTML = function(string) {
|
||||||
|
|
||||||
PromConsole.Graph.prototype._render = function(data) {
|
PromConsole.Graph.prototype._render = function(data) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var palette = new Rickshaw.Color.Palette();
|
var palette = new Rickshaw.Color.Palette({scheme: this.params.colorScheme});
|
||||||
var series = [];
|
var series = [];
|
||||||
|
|
||||||
// This will be used on resize.
|
// This will be used on resize.
|
||||||
|
|
Loading…
Reference in a new issue