charton 0.5.0

A high-performance, layered charting system for Rust, featuring a flexible data core and multi-backend rendering.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::chart::Chart;
use crate::mark::rule::MarkRule;

/// Extension implementation for `Chart` to support Rule lines (MarkRule).
impl Chart<MarkRule> {
    /// Configures the visual properties of the rule mark (thresholds, guides).
    pub fn configure_rule<F>(mut self, f: F) -> Self
    where
        F: FnOnce(MarkRule) -> MarkRule,
    {
        let mark = self.mark.take().unwrap_or_default();
        self.mark = Some(f(mark));
        self
    }
}