chart-svg: Charting library targetting SVGs.

[ bsd3, graphics, library ] [ Propose Tags ] [ Report a vulnerability ]

This package provides a charting library targetting SVG as the rendered output.

Usage

>>> :set -XOverloadedLabels
>>> :set -XOverloadedStrings
>>> import Chart
>>> import Optics.Core
>>> let 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]]
>>> let styles = (\c -> defaultLineStyle & set #color (palette c) & set #size 0.015) <$> [0..2]
>>> let cs = zipWith (\s x -> LineChart s [x]) styles lines
>>> let lineExample = mempty & set #chartTree (named "line" cs) & set #hudOptions defaultHudOptions :: ChartOptions
>>> writeChartOptions "other/usage.svg" lineExample

See Chart for concept design notes, and Chart.Examples for practical usage.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.1, 0.0.2, 0.0.3, 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.4.0, 0.4.1.0, 0.4.1.1, 0.5.0.0, 0.5.1.0, 0.5.1.1, 0.5.2.0, 0.6.0.0, 0.6.1.0, 0.7.0.0, 0.8.0.0 (info)
Change log ChangeLog.md
Dependencies base (>=4.14 && <5), bytestring (>=0.11.3 && <0.13), Color (>=0.3.2 && <0.4), containers (>=0.6 && <0.8), cubicbezier (>=0.6 && <0.7), flatparse (>=0.5 && <0.6), formatn (>=0.3 && <0.4), harpie (>=0.1 && <0.2), markup-parse (>=0.1 && <0.2), mtl (>=2.2.2 && <2.4), numhask (>=0.11 && <0.13), numhask-space (>=0.10 && <0.13), optics-core (>=0.4 && <0.5), random (>=1.2 && <1.3), string-interpolate (>=0.3 && <0.5), text (>=1.2 && <2.2), time (>=1.9 && <1.15) [details]
Tested with ghc ==9.10.1, ghc ==9.8.2, ghc ==9.6.5
License BSD-3-Clause
Copyright Tony Day (c) 2017
Author Tony Day
Maintainer tonyday567@gmail.com
Category graphics
Home page https://github.com/tonyday567/chart-svg#readme
Bug tracker https://github.com/tonyday567/chart-svg/issues
Source repo head: git clone https://github.com/tonyday567/chart-svg
Uploaded by tonyday567 at 2024-12-22T03:07:31Z
Distributions LTSHaskell:0.7.0.0, Stackage:0.7.0.0
Reverse Dependencies 5 direct, 2 indirect [details]
Downloads 3103 total (61 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-12-22 [all 1 reports]

Readme for chart-svg-0.8.0.0

[back to package description]

Table of Contents

  1. Usage
  2. Examples

img img

img

A charting library targetting SVG.

Usage

:r
:set prompt "> "
: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.

Examples

To redraw all the examples in Chart.Examples

import Chart.Examples
writeAllExamples

ok