Skip to content
Snippets Groups Projects
Commit 9f77dce1 authored by Ryan Senior's avatar Ryan Senior
Browse files

Fix the pulse bar chart rendering to use overriden columns

The bar chart rendering code was still using the old first/second
column logic, this commit switches it to using the new x/y axis column
logic which will account for user specified graph columns.

Fixes #6895
parent 2b74ed5c
Branches
Tags
No related merge requests found
......@@ -355,12 +355,19 @@
(render-table (prep-for-html-rendering timezone cols rows nil nil cols-limit))
(render-truncation-warning cols-limit (count cols) rows-limit (count rows))]})
(defn- graphing-columns [card {:keys [cols] :as data}]
[(or (ui-logic/x-axis-rowfn card data)
first)
(or (ui-logic/y-axis-rowfn card data)
second)])
(s/defn ^:private render:bar :- RenderedPulseCard
[timezone card {:keys [cols rows] :as data}]
(let [max-value (apply max (map second rows))]
(let [[x-axis-rowfn y-axis-rowfn] (graphing-columns card data)
max-value (apply max (map y-axis-rowfn rows))]
{:attachments nil
:content [:div
(render-table (prep-for-html-rendering timezone cols rows second max-value 2))
(render-table (prep-for-html-rendering timezone cols rows y-axis-rowfn max-value 2))
(render-truncation-warning 2 (count cols) rows-limit (count rows))]}))
(s/defn ^:private render:scalar :- RenderedPulseCard
......@@ -497,12 +504,6 @@
:attachment {content-id image-url}
:inline nil))
(defn- graphing-columns [card {:keys [cols] :as data}]
[(or (ui-logic/x-axis-rowfn card data)
first)
(or (ui-logic/y-axis-rowfn card data)
second)])
(s/defn ^:private render:sparkline :- RenderedPulseCard
[render-type timezone card {:keys [rows cols] :as data}]
(let [[x-axis-rowfn y-axis-rowfn] (graphing-columns card data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment