chart-cli: Command-line utility to draw charts from input data easily

[ bsd3, graphics, program ] [ Propose Tags ]

Please see the README on GitHub at

[Skip to Readme]
Versions [faq]
Change log
Dependencies attoparsec, base (>=4.7 && <5), Chart, Chart-cairo, colour, data-default-class, dates, filepath, hashable, lens, optparse-applicative, text, time [details]
License BSD-3-Clause
Copyright 2019 Ilya V. Portnov
Author Ilya V. Portnov
Category Graphics
Home page
Bug tracker
Source repo head: git clone
Uploaded by IlyaPortnov at 2019-08-25T12:13:53Z
Distributions NixOS:
Executables chart
Downloads 350 total (2 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
All reported builds failed as of 2019-08-25 [all 3 reports]


Maintainer's Corner

For package maintainers and hackage trustees

Readme for chart-cli-

[back to package description]

chart-cli README

This repo provides a chart command-line utility. chart is aimed to generate basic 2D charts from command line easily.

The chart utility is not aimed to give full control over generated charts, or to generate all possible types of charts - you may anytime do that by use of gnuplot or Chart package. This utility, instead, gives you a very quick way of generating some most useful types of charts.

Usage example:

$ cat > input.txt
X   Y1  Y2
1   1   3
2   4   6
3   7   4
4   5   8
6   3   2

$ chart --header -o lines.png input.txt



Supported chart types for now are:

  • Line charts (the default one)
  • Bar charts (clustered and stacked)
  • Area charts
  • Point charts

Other chart types may be added later.

Supported output formats are:

  • PNG (the default one)
  • SVG
  • PS (PostScript)
  • PDF

Output file format is automatically detected by specified output file name. If output file name is not specified explicitly, chart.png will be used.

Expected input format

Input data are expected to be provided as a series of lines; each line may represent either one point to plot, or several points at the same X coordinate.

The first line may optionally represent names of the columns.

Other lines should consist of several numbers. Numbers are separated with a delimiter. Default delimiter is TAB characater; you may specify another with -d command line option.

If only one number per line is provided, then these numbers will be used as Y values; for X values, line numbers (starting with 1) will be used.

If more than one number per line is provided, then for most chart types (except for bar charts) the first column will be used as X values, and other will be used as Y values.

In the first column, date/time values may be provided instead of numbers (to be used as values along X axis). Supported date/time formats are:

  • `12 September 2012'
  • today, tomorrow, yesterday
  • `in 2 days', '3 weeks ago'
  • `last monday', 'next friday'
  • last month' (1th of this month),next year' (1th of January of next year)

(thanks to dates package).

Command-line interface

I'll put it here for quick reference; more actual information is always accessible with chart --help:

Usage: chart [-o|--output OUTPUT.png] [COMMAND] [-1|--header]
             [-d|--delimiter CHAR] [-i|--index] [-t|--title TITLE]
             [-w|--width WIDTH] [-h|--height HEIGHT] [-b|--background COLOR]
             [-f|--foreground COLOR] [-L|--legend ON|OFF] [INPUT.txt]
  Make a chart

Available options:
  -o,--output OUTPUT.png   write output to OUTPUT.png
  -1,--header              first line contains column headers
  -d,--delimiter CHAR      specify fields delimiter ('\t' by default)
  -i,--index               if enabled, treat input data as if there was an
                           additional first column, containing line numbers,
                           starting from 1
  -t,--title TITLE         set chart title to TITLE
  -w,--width WIDTH         specify chart width, in pixels (default: 800)
  -h,--height HEIGHT       specify chart height, in pixels (default: 600)
  -b,--background COLOR    specify background color name (see SVG 1.1 spec)
  -f,--foreground COLOR    specify foreround color name (see SVG 1.1 spec)
  -L,--legend ON|OFF       enable or disable the legend (default: True)
  -h,--help                Show this help text

Available commands:
  line                     Make a line chart
  area                     Make an area chart
  points                   Make a points chart
  bar                      Make a bar chart


Install it by stack:

$ sudo apt-get install stack
$ git clone
$ cd chart-cli/
$ stack install