Liking cljdoc? Tell your friends :D

clj-xchart

Clojars Project cljdoc CI

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.

Installation

Leiningen/Boot:

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

deps.edn:

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

What

clj-xchart wraps all the different charts you can generate in XChart:

  • Line charts
  • Scatter charts
  • Area charts
  • Bar charts
  • Histogram charts
  • Pie charts
  • Donut charts
  • Bubble charts
  • Stick charts

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 Savyasachi. Original: https://github.com/hyPiRion/clj-xchart

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:
Jean Niklas L'orange & Savyasachi
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