                              XChartPanel)
            (org.knowm.xchart.style Styler
                                    Styler$LegendPosition
+                                   PieStyler$AnnotationType
                                    GGPlot2Theme
                                    MatlabTheme
                                    XChartTheme)

(def pie-render-styles
  {:pie PieSeries$PieSeriesRenderStyle/Pie
   :donut PieSeries$PieSeriesRenderStyle/Donut})

(def legend-positions
  {:inside-n Styler$LegendPosition/InsideN

      (.getStyler chart)
      theme (.setTheme (themes theme theme))
      render-style (.setDefaultSeriesRenderStyle (pie-render-styles render-style))
      (not (nil? circular)) (.setCircular (boolean circular))
      (not (nil? draw-all-annotations)) (.setDrawAllAnnotations (boolean draw-all-annotations))
      annotation-distance (.setAnnotationDistance (double annotation-distance))
      donut-thickness (.setDonutThickness (double donut-thickness))
      start-angle (.setStartAngleInDegrees (double start-angle))
      annotation-type (.setAnnotationType (pie-annotation-types annotation-type)))
     (set-default-style! (.getStyler chart) styling)
     (doto-cond
      chart
      title (.setTitle title)))))
