com.hypirion.clj-xchart

If you haven't looked at the tutorial for clj-xchart, consider doing so before reading the API reference.

add-bubble-series!

(add-bubble-series! chart s-name data)
Adds an additional bubble series to the provided bubble chart. It is
preferable to provide all series upfront instead of mutating the underlying
chart. For other chart types, see the add-series! function.

add-series!

(add-series! chart s-name data)
Adds an XY or category series to an already existing chart. It is preferable
to provide all series upfront to avoid mutable operations on a chart.

For bubble-charts, use `add-bubble-series!`. For pie charts, just use
(.addSeries chart name val).

as-buffered-image

(as-buffered-image chart)
Converts a chart into a java.awt.image.BufferedImage.

bubble-chart*

(bubble-chart* series)(bubble-chart* series {:keys [width height title theme render-style], :or {width 640, height 500}, :as styling})
Returns a raw bubble chart. Bubble charts are hard to make right,
so please see the tutorial for more information about how to create
one. The render-styles page will give you information about styling
options.

bubble-render-styles

Different render styles for bubble series. For now this is useless, as you
can only use :round. Apparently :box is around the corner though.

category-chart

(category-chart series)(category-chart series {:keys [x-axis series-order], :as styling})
Returns a category chart. See the tutorial for more information
about how to create category charts, and see the render-styles
documentation for styling options.

category-chart*

(category-chart* series)(category-chart* series {:keys [width height title theme render-style available-space-fill overlap?], :or {width 640, height 500}, :as styling})
Returns a raw category chart. Prefer `category-chart` unless you
run into performance issues. See the tutorial for more information
about how to create category charts, and see the render-styles
documentation for styling options.

category-render-styles

The different styles you can use for category series.

colors

All the default java.awt colors as keywords. You can use this map
to iterate over the keys, in case you'd like to compare different
colors. Or you could use java.awt.Color directly to use the exact
color you want.

extract-series

(extract-series keymap coll)
Transforms coll into a series map by using the values in the provided keymap.
There's no requirement to provide :x or :y (or any key at all, for that
matter), although that's common.

Example: (extract-series {:x f, :y g, :bubble bubble} coll)
      == {:x (map f coll), :y (map g coll), :bubble (map bubble coll)}

legend-positions

The different legend positions. Note that xchart implements only a
subset of inside/outside for the different positions.

markers

All the default XChart markers as keywords. To create your own marker, you
must _subclass_ the org.knowm.xchart.style.markers.Marker class, so it's often
better to use the default ones.

pie-annotation-types

The different annotation types you can use to annotate pie charts.
By default, this is :percentage.

pie-chart

(pie-chart series)(pie-chart series {:keys [width height title circular? theme render-style annotation-distance start-angle draw-all-annotations? donut-thickness annotation-type], :or {width 640, height 500}, :as styling})
Returns a pie chart. The series map is in this case just a mapping
from string to number. For styling information, see the
render-styles page.

Example:
(c/pie-chart {"Red" 54
              "Green" 34})

pie-render-styles

The different pie render styles. It is :pie by default.

spit

(spit chart fname)(spit chart fname type)
Spits the chart to the given filename. If no type is provided, the type is
guessed by the filename extension. If no extension is found, an error is
raised.

strokes

The default stroke types provided by XChart. You can also use a self-made
stroke if you're not happy with any of the predefined ones.

text-alignments

The different kinds of text alignments you can use.

themes

The different default themes you can use with xchart.

to-bytes

(to-bytes chart type)
Converts a chart into a byte array.

transpose-map

(transpose-map series)
Transforms a map of maps such that the inner keys and outer keys are flipped.
That is, `(get-in m [k1 k2])` = `(get-in (transpose-map m) [k2 k1])`. The
inner values remain the same.

view

(view & charts)
Utility function to render one or more charts in a swing frame.

xy-chart

(xy-chart series)(xy-chart series {:keys [width height title theme render-style], :or {width 640, height 500}, :as styling})
Returns an xy-chart. See the tutorial for more information about
how to create an xy-chart, and see the render-styles documentation
for styling options.

xy-render-styles

The different xy-render styles: :area, :scatter and :line.