[][src]Crate charts

rustplotlib

A visualization library for Rust inspired by D3.js.

Features

This is a WIP, but so far the library supports the following chart types:

  1. Bar Chart (horizontal and vertical)
  2. Stacked Bar Chart (horizontal and vertical)

Abstraction Layers

There are several abstractions at the foundation of this visualization library:

Page └- Grid └- Chart ├- Axes └- View └- Dataset

TODO represent the structure visually

Structs

Axis

An axis struct that represents an axis along a dimension of the chart.

Chart

The Chart struct definition. A Chart is the smallest entity that can be saved (the bigger one is a Page (TBD)).

Color

A struct that represents a color.

HorizontalBarView

A View that represents data as horizontal bars.

ScaleBand

The scale to represent categorical data.

ScaleLinear

The scale to represent categorical data.

ScatterView

A View that represents data as a scatter plot.

VerticalBarView

A View that represents data as vertical bars.

Enums

BarLabelPosition

Set the position of a bar's label.

MarkerType

Define the possible types of points in a scatter plot.

PointLabelPosition

Define the possible locations of a point's label.

Traits

BarDatum

A trait that defines interaction with a data point used in a bar chart. This provides greater flexibility in using different data sources as one can simply implement this trait and be able to use that data in a bar chart.

PointDatum

A trait that defines interaction with a data point used in a scatter/line plots.

Scale

The Scale trait defines common operations on all scales.