From 05dba96ebfff955a2cce32e47240e405116d780b Mon Sep 17 00:00:00 2001 From: Dorian JAMINAIS <724390+nanassito@users.noreply.github.com> Date: Thu, 19 Aug 2021 23:24:31 -0700 Subject: [PATCH] Add option for the number of ticks in PromConsole.Graph (#9223) Signed-off-by: Dorian Jaminais-Grellier --- web/ui/static/js/prom_console.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/ui/static/js/prom_console.js b/web/ui/static/js/prom_console.js index 1df18440f..9234d3c14 100644 --- a/web/ui/static/js/prom_console.js +++ b/web/ui/static/js/prom_console.js @@ -320,6 +320,8 @@ PromConsole.graphDefaults = { yTitle: "", // The title of the y axis. // Number formatter for y axis. yAxisFormatter: PromConsole.NumberFormatter.humanize, + // Number of ticks (horizontal lines) for the y axis + yAxisTicks: null, // 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 @@ -529,7 +531,8 @@ PromConsole.Graph.prototype._render = function(data) { }); var yAxis = new Rickshaw.Graph.Axis.Y({ graph: graph, - tickFormat: this.params.yAxisFormatter + tickFormat: this.params.yAxisFormatter, + ticks: this.params.yAxisTicks }); var xAxis = new Rickshaw.Graph.Axis.Time({ graph: graph,