dataviz::figure::datasets::dataset

Trait Dataset

source
pub trait Dataset {
    // Required methods
    fn get_points(&self) -> Vec<(f64, f64)>;
    fn add_point(&mut self, point: (f64, f64));
}
Expand description

A trait for managing datasets used in different types of charts or graphs.

Required Methods§

source

fn get_points(&self) -> Vec<(f64, f64)>

Retrieves all points in the dataset as a vector of (x, y) tuples.

§Returns

A vector of (f64, f64) representing the data points in the dataset.

source

fn add_point(&mut self, point: (f64, f64))

Adds a single point to the dataset.

§Parameters
  • point: A tuple (f64, f64) representing the x and y coordinates of the point to add.

Implementors§