(add-annotation! chart annotation)Adds an annotation map to an axes chart and returns the chart.
Text, image, and text-panel annotations use :x and :y; line annotations use :value plus :orientation (:vertical or :horizontal). Values are in chart coordinates by default. Set :coordinate-space :screen or :screen-space? true to interpret them as screen pixels. Supported :type values are :text, :line, :vertical-line, :horizontal-line, :image, and :text-panel (or :panel).
Adds an annotation map to an axes chart and returns the chart. Text, image, and text-panel annotations use :x and :y; line annotations use :value plus :orientation (:vertical or :horizontal). Values are in chart coordinates by default. Set :coordinate-space :screen or :screen-space? true to interpret them as screen pixels. Supported :type values are :text, :line, :vertical-line, :horizontal-line, :image, and :text-panel (or :panel).
(add-annotations! chart annotations)Adds each annotation map in annotations to an axes chart and returns it.
See add-annotation! for chart-space and screen-space coordinate semantics.
Adds each annotation map in `annotations` to an axes chart and returns it. See `add-annotation!` for chart-space and screen-space coordinate semantics.
(as-buffered-image chart)Converts a chart into a java.awt.image.BufferedImage.
Converts a chart into a java.awt.image.BufferedImage.
(box-chart series)(box-chart series
{:keys [width height title theme annotations]
:or {width 640 height 500}
:as styling})Returns a box chart. Each series is a collection of numeric values, or a map containing :values and optional :style entries.
Returns a box chart. Each series is a collection of numeric values, or a map containing :values and optional :style entries.
(bubble-chart series size)(bubble-chart series
{in :in [out-val out-type] :out :as bubble-size}
{:keys [width height] :or {width 640 height 500} :as styling})Returns a bubble chart for series, scaling bubble diameters per size.
size is a map {:in <number or :max> :out [<value> <unit>]} where the input
bubble value :in (or :max, the largest value in the series) maps to an
output diameter :out given in :px/:pixels or :%/:percent of the chart's
larger dimension. styling accepts the same keys as bubble-chart*.
Returns a bubble chart for `series`, scaling bubble diameters per `size`.
`size` is a map {:in <number or :max> :out [<value> <unit>]} where the input
bubble value `:in` (or :max, the largest value in the series) maps to an
output diameter `:out` given in :px/:pixels or :%/:percent of the chart's
larger dimension. `styling` accepts the same keys as `bubble-chart*`.(bubble-chart* series)(bubble-chart* series
{:keys [width height title theme render-style annotations]
: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.
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.
Different render styles for bubble series. For now this is useless, as you can only use :round. Apparently :box is around the corner though.
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 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.
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* series)(category-chart* series
{:keys [width height title theme render-style
available-space-fill overlap? stacked? annotations]
: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.
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.
The different styles you can use for category series.
The different styles you can use for category series.
Protocol for charts, which extends the XChart charts with additional polymorphic Clojure functions.
Protocol for charts, which extends the XChart charts with additional polymorphic Clojure functions.
(add-series! chart series-name data)A method to add new series to the provided chart
A method to add new series to the provided chart
The directions in which pie slices can be drawn.
The directions in which pie slices can be drawn.
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.
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.
(dial-chart series)(dial-chart
series
{:keys [width height title theme] :or {width 640 height 500} :as styling})Returns a dial chart. The series map values are numbers or maps containing :value, an optional :label, and an optional :style map. XChart displays one dial series at a time.
Returns a dial chart. The series map values are numbers or maps containing :value, an optional :label, and an optional :style map. XChart displays one dial series at a time.
(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)}
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)}(heat-map-chart series)(heat-map-chart
series
{:keys [width height title theme] :or {width 640 height 500} :as styling})Returns a heat map chart. The series map must contain exactly one named series with :x-labels, :y-labels, and :heat-data. Heat data may be a matrix of row values or indexed [x-index y-index value] rows.
Returns a heat map chart. The series map must contain exactly one named series with :x-labels, :y-labels, and :heat-data. Heat data may be a matrix of row values or indexed [x-index y-index value] rows.
(horizontal-bar-chart series)(horizontal-bar-chart series
{:keys [width height title theme annotations]
:or {width 640 height 500}
:as styling})Returns a horizontal bar chart. Series x values are numeric bar lengths and y values are category labels.
Returns a horizontal bar chart. Series x values are numeric bar lengths and y values are category labels.
The vertical and horizontal legend layouts.
The vertical and horizontal legend layouts.
The different legend positions. Note that xchart implements only a subset of inside/outside for the different positions.
The different legend positions. Note that xchart implements only a subset of inside/outside for the different positions.
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.
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.
(normalize-categories m)Normalizes a category-series map m so that every series shares the same set
of x-values, filling any missing entries. Useful before handing data to
category-chart, which expects aligned categories across series.
Normalizes a category-series map `m` so that every series shares the same set of x-values, filling any missing entries. Useful before handing data to `category-chart`, which expects aligned categories across series.
(ohlc-chart series)(ohlc-chart series
{:keys [width height title theme annotations]
:or {width 640 height 500}
:as styling})Returns an OHLC chart. Series may contain :x, :open, :high, :low, and :close data with optional :volume; :open, :high, :low, and :close without explicit x data; or :x and :y line data. See the render-styles documentation for styling options.
Returns an OHLC chart. Series may contain :x, :open, :high, :low, and :close data with optional :volume; :open, :high, :low, and :close without explicit x data; or :x and :y line data. See the render-styles documentation for styling options.
The different styles you can use for OHLC series.
The different styles you can use for OHLC series.
The different annotation types you can use to annotate pie charts. By default, this is :percentage. (XChart renamed AnnotationType to LabelType in 4.x; :label maps to the slice name.)
The different annotation types you can use to annotate pie charts. By default, this is :percentage. (XChart renamed AnnotationType to LabelType in 4.x; :label maps to the slice name.)
(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})
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})The different pie render styles. It is :pie by default.
The different pie render styles. It is :pie by default.
(radar-chart series styling)Returns a radar chart. Supply chart-level :radii-labels and map each series name to values or to a map containing :values, optional :tooltips, and an optional :style map.
Returns a radar chart. Supply chart-level :radii-labels and map each series name to values or to a map containing :values, optional :tooltips, and an optional :style map.
The different styles you can use to render radar charts.
The different styles you can use to render radar charts.
XChart's built-in accessible and print-friendly series color palettes.
XChart's built-in accessible and print-friendly series color palettes.
(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.
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.
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.
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.
The different kinds of text alignments you can use.
The different kinds of text alignments you can use.
The different default themes you can use with xchart.
The different default themes you can use with xchart.
(to-bytes chart type)Converts a chart into a byte array.
Converts a chart into a byte array.
The label combinations shown in XChart tooltips.
The label combinations shown in XChart tooltips.
(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.
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 & charts)Utility function to render one or more charts in a swing frame.
Utility function to render one or more charts in a swing frame.
(xy-chart series)(xy-chart series
{:keys [width height title theme render-style annotations]
: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.
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.
The different xy-render styles: :area, :scatter and :line.
The different xy-render styles: :area, :scatter and :line.
The positions available for grouped y axes.
The positions available for grouped y axes.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |