Fusuma

Components / Components

line_chart

A line through values, scaled between their smallest and largest (change that with Chart::range).

Try it

This is the Data page of the gallery, running in your browser: line_chart is on it, and it is the real widget. Press Run, then use it.

Live: Data, where line_chart is usedOpen full size

Also on this pagespinnerkbdratingcarouseltimelinetablearea_chartbar_chart

A line through values, scaled between their smallest and largest (change that with Chart::range).

The chart is scaled between the smallest and the largest value, or between the two .range(values, lo, hi) gives. At most CHART_MAX values are drawn.

Signature

pub fn line_chart(values: &[i32]) -> Chart

Methods

  • .range(values: &[i32], lo: i32, hi: i32) -> Self — Scales between lo and hi instead of the data's own smallest and largest, so two charts of the same thing agree and a bar chart can start at 0.
  • .size(width: u32, height: u32) -> Self — width x height pixels (the theme's size by default).

Example

use fusuma::line_chart;
let view = line_chart(&[3, 5, 4, 8, 6]).size(300, 80);
let built = fusuma::doc::built::<(), _>(&view);
assert_eq!(built.nodes(), 1);

All components · Source