1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Histogram plot implementation
//!
//! Creates 1D histograms from raw values or pre-binned data, with support for
//! filled/unfilled style and overlaid multiple series.
use crateHistogramData;
use crateHistogramPlotOptions;
use cratePlot;
use cratePlotBytes;
use craterender_histogram;
use crateRenderConfig;
use Result;
/// Histogram plot implementation
///
/// Creates 1D histograms with x-axis = values, y-axis = count/frequency.
/// Supports raw values (auto-binned), pre-binned data, and overlaid series.
///
/// # Example
///
/// ```rust,no_run
/// use flow_plots::plots::histogram::HistogramPlot;
/// use flow_plots::plots::traits::Plot;
/// use flow_plots::options::{BasePlotOptions, HistogramPlotOptions};
/// use flow_plots::histogram_data::HistogramData;
/// use flow_plots::render::RenderConfig;
///
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let plot = HistogramPlot::new();
/// let options = HistogramPlotOptions::new()
/// .base(BasePlotOptions::new().width(800u32).height(600u32).build()?)
/// .histogram_filled(true)
/// .build()?;
/// let data = HistogramData::from_values(vec![1.0, 2.0, 2.0, 3.0, 3.0, 3.0]);
/// let mut render_config = RenderConfig::default();
/// let bytes = plot.render(data, &options, &mut render_config)?;
/// # Ok(())
/// # }
/// ```
;