Liking cljdoc? Tell your friends :D

clj-xchart

Clojars Project cljdoc test

Clojure wrapper around XChart, a small library for rendering charts/plots.

Rosling chart

Maintenance fork of hyPiRion/clj-xchart, ported to XChart 4.x / Clojure 1.12 and published to Clojars as net.clojars.savya/clj-xchart.

Stack

Clojure deps.edn tools.build XChart

What

The constructors cover XChart 4.0.3's full chart-type set:

  • XY charts: line, scatter, area, step, step-area, and polygon-area
  • Category charts: bar, stepped-bar, line, area, scatter, and stick
  • Pie and donut charts
  • Bubble charts
  • OHLC charts: candle, hi-lo, and line
  • Box (box-and-whisker) charts
  • Horizontal bar charts
  • Dial charts
  • Radar charts: polygon and circle
  • Heat-map charts

Alongside the chart types, the keyword-based styling covers the full marker and render-style set, accessible and printer-friendly color presets, the current XChart styler options, and chart-space or screen-space annotations for axes charts. Existing constructors and keyword-based styling remain compatible.

Installation

Leiningen/Boot:

[net.clojars.savya/clj-xchart "0.4.0"]

deps.edn:

net.clojars.savya/clj-xchart {:mvn/version "0.4.0"}

Usage

There are a lot of examples on the examples page, and the tutorial covers basic usage. For more advanced customisation, have a look at the render options page.

(require '[com.hypirion.clj-xchart :as c])

(-> (c/xy-chart {"y = x" {:x [1 2 3] :y [1 2 3]}
                 "y = 2x" {:x [1 2 3] :y [2 4 6]}})
    (c/spit "chart.png"))

The Clojure namespace is still com.hypirion.clj-xchart, so existing require forms keep working; only the Clojars coordinate changed.

Compatibility

XChart 4.x reorganised its API (the vector-graphics export, the styler hierarchy, and the pie "annotations" which are now "labels"). This fork tracks those changes while keeping clj-xchart's own keyword-based API unchanged, so charts written against earlier com.hypirion/clj-xchart releases keep rendering. See CHANGELOG.md for details.

License

Copyright © 2016 Jean Niklas L'orange.

Maintenance fork (2026) by Savyasachi, original: https://github.com/hyPiRion/clj-xchart. Distributed under the Eclipse Public License 1.0, preserving the original license.

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Can you improve this documentation? These fine people already did:
Savyasachi & Jean Niklas L'orange
Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close