    {:pre [series]}
    (let [chart (XYChart. width height)]
      (doseq [[s-name data] series]
-       (if (sequential? data)
-         (apply add-series chart s-name data)
-         (let [{:keys [x y error-bars style]} data
-               {:keys [marker-color marker-type
-                       line-color line-style line-width
-                       fill-color show-in-legend render-style]} style]
-           (doto-cond
-            (if error-bars
-              (add-series chart s-name x y error-bars)
-              (add-series chart s-name x y))
-            marker-color (.setMarkerColor (colors marker-color marker-color))
-            marker-type (.setMarker (markers marker-type marker-type))
-            line-color (.setLineColor (colors line-color line-color))
-            line-style (.setLineStyle line-style)
-            line-width (.setLineWidth (float line-width))
-            fill-color (.setFillColor (colors fill-color fill-color))
-            (not (nil? show-in-legend)) (.setShowInLegend (boolean show-in-legend))
-            render-style (.setXYSeriesRenderStyle (xy-render-styles render-style))))))
+       (let [render-style (-> data :style :render-style)]
+         (doto-cond (add-series chart s-name data)
+          render-style (.setXYSeriesRenderStyle (xy-render-styles render-style)))))
      (doto-cond
       (.getStyler chart)
       theme (.setTheme (themes theme theme))
       render-style (.setDefaultSeriesRenderStyle (xy-render-styles render-style)))
+     (doto (.getStyler chart)
+       (set-default-style! styling)
+       (set-axes-style! styling))
+     (doto-cond
+      chart
+      title (.setTitle title)))))
+
+(defn category-chart
+  "Returns a category chart"
+  ([series]
+   (category-chart series {}))
+  ([series
+    {:keys [width height title theme render-style available-space-fill overlap?]
+     :or {width 640 height 500}
+     :as styling}]
+   {:pre [series]}
+   (let [chart (CategoryChart. width height)]
+     (doseq [[s-name data] series]
+       (let [render-style (-> data :style :render-style)]
+         (doto-cond (add-series chart s-name data)
+          render-style (.setChartCategorySeriesRenderStyle
+                        (category-render-styles render-style)))))
+     (doto-cond
+      (.getStyler chart)
+      theme (.setTheme (themes theme theme))
+      render-style (.setDefaultSeriesRenderStyle (category-render-styles render-style))
+      available-space-fill (.setAvailableSpaceFill (double available-space-fill))
+      (not (nil? overlap?))  (.setOverlapped (boolean overlap?)))
      (doto (.getStyler chart)
        (set-default-style! styling)
        (set-axes-style! styling))

(ns com.hypirion.clj-xchart
  (:import (org.knowm.xchart XYChart
                             PieChart
                             PieSeries$PieSeriesRenderStyle
                             XYSeries$XYSeriesRenderStyle
                             XChartPanel)

           (java.awt Color
                     GridLayout)))

(def colors
  {:blue Color/BLUE
   :black Color/BLACK
