                                                          (/ (- item-height square-size)
                                                             2)))]
                                           (gstring/format "translate(%s,%s)" tr-x  tr-y)))}))]
-      (-> legend-item
+      ;; left legend
+      (-> left-legend-item
           (.append "rect")
-          (.attr #js {"width" (:square-size legend-dimensions)
-                      "height" (:square-size legend-dimensions)
+          (.attr #js {"width" square-size
+                      "height" square-size
                       "class" #(.-class_name %)
                       "transform"
                       (fn [item i]
-                        (gstring/format "translate(%s,%s)" 0  (- (+ (:square-size legend-dimensions)))))}))
-      (-> legend-item
+                        (gstring/format "translate(%s,%s)" 0  (- (+ square-size))))}))
+      (-> left-legend-item
           (.append "text")
-          (.attr #js {"x" (+ (:square-size legend-dimensions)
-                             (:spacing legend-dimensions))})
+          (.attr #js {"x" (+ square-size spacing)})
+          (.text #(.-text %)))
+
+      ;; right legend
+      (-> right-legend-item
+          (.append "rect")
+          (.attr #js {"width" square-size
+                      "height" square-size
+                      "class" #(.-class_name %)
+                      "transform"
+                      (fn [item i]
+                        (gstring/format "translate(%s,%s)" 0  (- (+ square-size))))}))
+      (-> right-legend-item
+          (.append "text")
+          (.attr #js {"x" (+ square-size
+                             spacing)})
           (.text #(.-text %))))
-
 
     ;; y-axis
     (-> svg

  (let [key-mapping {:queued_time_minutes :queued_time_millis
                     :build_time_minutes :build_time_millis}]
    (reduce-kv (fn [accum new-key old-key]
                 (assoc accum new-key (/ (get build old-key) 1000 60)))
               build
               key-mapping)))


                                              tr-y (- (- item-height
                                                         (/ (- item-height square-size)
                                                            2)))]
                                          (gstring/format "translate(%s,%s)" tr-x  tr-y)))}))
          right-legend-item (-> svg
                          (.selectAll ".legend-right")
                          (.data (clj->js right-legend))
                          (.enter)
