     (draw-labels scale (labels ds))))
 
 (defn make-radar-panel
-  [ds width height]
+  [ds width height title]
   (doto
       (proxy [javax.swing.JComponent] []
         (paintComponent [g]
                         (with-antialiasing g
-                          (draw-radar ds (.getWidth this) (.getHeight this)))))))
+                          (draw-radar ds (.getWidth this) (.getHeight this) title))))))
 
 (defn show-radar-display-in-frame
   "Display a new window with a radar plot of the given data items.

  (doseq [[x y] (polar->cartesian polars)]
    (line 0 0 x y)))

(defn draw-labels
  [scale labels]
  (doseq [[l [r theta]] labels]
    (let [[cx cy] (polar->cartesian (* scale r) theta)
          layout (text-layout l)
          bounds (.getBounds layout)]
      (.draw layout *graphics*
                   (float (- cx (.x bounds) (/ (.width bounds) 2.0)))
                   (float (- cy (.y bounds) (/ (.height bounds) 2.0)))))))

(defn draw-radar
  [ds w h]
  (set-color color-background)
  (fill-rect 0 0 w h)
  (let [scale (/ (min (- w 60) (- h 60)) 2.0)]
    (translate (/ w 2.0) (/ h 2.0))
    (with-scaling scale
      (set-pen-width 1.5)

      (set-color color-axis)
      (draw-radials (axes ds))
      (set-pen-width 3.0)


(defn write-radar-display-to-file
  [ds filename & options]
  (let [{:keys [width height title]} (into default-frame-options (apply hash-map options))
        image (BufferedImage. width height BufferedImage/TYPE_INT_RGB)
        image-type (type-from-file filename)]
    (with-antialiasing (.createGraphics image)
      (draw-radar ds width height title))
    (ImageIO/write image image-type (File. filename))))


(comment
  (def test-data
    '[("Performance" 1 10)
      ("Security" 2 5)
      ("Scalability" 7 10)
      ("Availability" 8 10)
      ("Portability" 5 10)
      ("Modifiability" 3 10)])

  (show-radar-display-in-frame test-data :title "Solution A")

  (write-radar-display-to-file test-data "/tmp/radar.png" :title "Solution A")
  )
