About

Metadata

  • Last updated , by tonyday567
  • License BSD-3-Clause
  • Categories Graphics
  • Maintained by: tonyday567@gmail.com

  • Lottery factor: 1

Links

Installation

Tested Compilers

  1. 9.12.2
  2. 9.10.3

Readme

img img

img

A charting library targetting SVG.

Usage

:r
:set -XOverloadedLabels
:set -XOverloadedStrings
import Chart
import Optics.Core
lines = [[Point 0.0 1.0, Point 1.0 1.0, Point 2.0 5.0],[Point 0.0 0.0, Point 2.8 3.0],[Point 0.5 4.0, Point 0.5 0]]
styles = (\c -> defaultLineStyle & #color .~ palette c & #size .~ 0.015) <$> [0..2]
cs = zipWith (\s x -> LineChart s [x]) styles lines
lineExample = mempty & #chartTree .~ named "line" cs & #hudOptions .~ defaultHudOptions :: ChartOptions
writeChartOptions "other/usage.svg" lineExample

img

See the haddock documentation for a detailed overview.

To redraw all the examples in Chart.Examples

import Chart.Examples
writeAllExamples