Module charts

Source
Expand description

Draw charts with plotters during unit-testing.

Modules§

full_palette
A full color palette derived from the Material Design 2014 Color Palette. Colors are chosen to go well with each other, and each color is available in several tints, ranging from 50 (very light) to 900 (very dark). A tint of 500 is considered “standard”. Color’s whose tint starts with an ‘A’ (for example RED_A400) are accent colors and are more saturated than their standard counterparts.

Structs§

AreaSeries
An area series is similar to a line series but uses a filled polygon. It takes an iterator of data points in guest coordinate system and creates appropriate lines and points with the given style.
BitMapBackend
The backend that drawing a bitmap
BitMapElement
The element that contains a bitmap on it
BlackWhite
Simple chromatic colormap from black to white.
Bone
Dark colormap going from black over blue to white.
Boxplot
The boxplot element
CandleStick
The candlestick data point element
Cartesian2d
A 2D Cartesian coordinate system described by two 1D ranged coordinate specs.
ChartBuilder
The helper object to create a chart context, which is used for the high-level figure drawing.
ChartContext
The context of the chart. This is the core object of Plotters.
Circle
A circle element
Copper
Friendly black to brown colormap.
Cross
A cross marker for visualizing data series.
Cubiod
Represents a cuboid, a six-faced solid.
DashedLineSeries
A dashed line series, map an iterable object to the dashed line element. Can be used to draw simple dashed and dotted lines.
DerivedColorMap
This struct is used to dynamically construct colormaps by giving it a slice of colors. It can then be used when being intantiated, but not with associated functions.
DottedLineSeries
A dotted line series, map an iterable object to the dotted line element.
DrawingArea
The abstraction of a drawing area. Plotters uses drawing area as the fundamental abstraction for the high level drawing API. The major functionality provided by the drawing area is
DummyBackendError
This is the dummy backend placeholder for the backend that never fails
DynElement
The container for a dynamically dispatched element
EmptyElement
An empty composable element. This is the starting point of a composed element.
ErrorBar
An error bar, which visualizes the minimum, average, and maximum of a dataset.
FontDesc
Describes a font
GroupBy
Grouping the value in the coordinate specification.
HSLColor
The color described by HSL color space
Histogram
Presents data in a histogram. Input data can be raw or aggregated.
LineSeries
The line series object, which takes an iterator of data points in guest coordinate system and creates appropriate lines and points with the given style.
Linspace
The coordinate combinator that transform a continuous coordinate to a discrete coordinate to a discrete coordinate by a giving step.
LogCoord
A log scaled coordinate axis
LogRangeDeprecated
The logarithmic coordinate decorator. This decorator is used to make the axis rendered as logarithmically.
MandelbrotHSL
Colormap created to replace the one used in the mandelbrot example.
MultiLineText
An multi-line text element. The Text element allows only single line text and the MultiLineText supports drawing multiple lines
NestedRange
A nested coordinate spec which is a discrete coordinate on the top level and for each value in discrete value, there is a secondary coordinate system. And the value is defined as a tuple of primary coordinate value and secondary coordinate value
Palette99
The palette of 99% accessibility
Palette100
The palette of 100% accessibility
Palette9999
The palette of 99.99% accessibility
PaletteColor
A color in the given palette
PathElement
An element of a series of connected lines
Pie
A Pie Graph
Pixel
An element representing a single pixel.
PointSeries
The point plot object, which takes an iterator of points in guest coordinate system and create an element for each point
Polygon
An element of a filled polygon
Quartiles
The quartiles
RGBAColor
The RGBA representation of the color, Plotters use RGBA as the internal representation of color
RGBColor
The color described by its RGB value
RangedDate
The ranged coordinate for date
RangedDateTime
The ranged coordinate for the date and time
RangedDuration
The coordinate that for duration of time
Rect
The representation of the rectangle in backend canvas
Rectangle
A rectangle element
SVGBackend
The SVG image drawing backend
ShapeStyle
Style for any shape
SurfaceSeries
Represents functions of two variables.
Text
A single line text element. This can be owned or borrowed string, dependents on String or str moved into.
TextStyle
Style of a text
TriangleMarker
A triangle marker for visualizing data series.
ViridisRGB
A colormap optimized for visually impaired people (RGB Format). It is currently the default colormap also used by matplotlib. Read more in this paper
ViridisRGBA
A colormap optimized for visually impaired people (RGBA format). It is currently the default colormap also used by matplotlib. Read more in this paper
VulcanoHSL
A vulcanic colormap that display red/orange and black colors

Enums§

DrawingAreaErrorKind
The error description of any drawing area API
FontFamily
Describes font family. This can be either a specific font family name, such as “arial”, or a general font family class, such as “serif” and “sans-serif”
FontStyle
Describes the font style. Such as Italic, Oblique, etc.
FontTransform
Specifying text transformations
LabelAreaPosition
Specifies one of the four label positions around the figure.
NestedValue
Describe a value for a nested coordinate
SegmentValue
The value that used by the segmented coordinate.
SeriesLabelPosition
Useful to specify the position of the series label.

Constants§

BLACK
Black ( rgb = (0, 0, 0))
BLUE
Blue ( rgb = (0, 0, 255))
CYAN
Cyan ( rgb = (0, 255, 255))
GREEN
Green ( rgb = (0, 255, 0))
MAGENTA
Magenta ( rgb = (255, 0, 255))
RED
Red ( rgb = (255, 0, 0))
TRANSPARENT
Transparent ( rgba = (0, 0, 0, 0.0))
WHITE
White ( rgb = (255, 255, 255))
YELLOW
Yellow ( rgb = (255, 255, 0))

Traits§

AsRelative
Allows a value turns into a relative size
BindKeyPointMethod
Bind an existing coordinate spec with a given key points algorithm. See WithKeyPointMethod for more details.
BindKeyPoints
Bind a existing coordinate spec with a given key points vector. See WithKeyPoints for more details.
BuildNestedCoord
Used to build a nested coordinate system.
Color
Any color representation
ColorMap
Converts scalar values to colors.
CoordTranslate
The trait that translates some customized object to the backend coordinate
DiscreteRanged
The trait indicates the coordinate is discrete This means we can bidirectionally map the range value to 0 to N in which N is the number of distinct values of the range.
DrawingBackend
The drawing backend trait, which implements the low-level drawing APIs. This trait has a set of default implementation. And the minimal requirement of implementing a drawing backend is implementing the draw_pixel function.
IntoDrawingArea
A type which can be converted into a root drawing area
IntoDynElement
The trait that makes the conversion from the statically dispatched element to the dynamically dispatched element
IntoFont
The trait that allows some type turns into a font description
IntoLinspace
Makes a linspace coordinate from the ranged coordinates.
IntoLogRange
Convert a range to a log scale coordinate spec
IntoMonthly
The trait that converts a normal date coord into a monthly one
IntoPartialAxis
The trait for the types that can be converted into a partial axis
IntoSegmentedCoord
The trait for types that can decorated by SegmentedCoord decorator.
IntoTextStyle
Trait for values that can be converted into TextStyle values
IntoYearly
The trait that converts a normal date coord into a yearly one
LogScalable
The trait for the type that is able to be presented in the log scale. This trait is primarily used by LogRangeExt.
Palette
Represents a color palette
Ranged
The trait that indicates we have a ordered and ranged value Which is used to describe any 1D axis.
ToGroupByRange
The trait that provides method Self::group_by function which creates a GroupBy decorated ranged value.

Functions§

draw_multi_vec_charts
Draw multiple vectors as line charts.
draw_vec_chart
Draw a Vec<f32> as a line chart under filename.
generate_frequency_response_plot
Generates a frequency response plot for a given audio processor
make_partial_axis
Make a partial axis based on the percentage of visible portion. We can use into_partial_axis to create a partial axis range specification. But sometimes, we want to directly specify the percentage visible to the user.

Type Aliases§

DrawResult
The type used to returns a drawing operation that can be failed
PathDeprecated
This is a deprecated type. Please use new name PathElement instead.