pub struct ChartContext {
pub canvas: BrailleCanvas,
}Fields§
§canvas: BrailleCanvasImplementations§
Source§impl ChartContext
impl ChartContext
pub fn new(width: usize, height: usize) -> Self
Sourcepub fn get_auto_range(
points: &[(f64, f64)],
padding: f64,
) -> ((f64, f64), (f64, f64))
pub fn get_auto_range( points: &[(f64, f64)], padding: f64, ) -> ((f64, f64), (f64, f64))
Calcula automáticamente el rango (min, max) de una serie de puntos.
pub fn scatter(&mut self, points: &[(f64, f64)], color: Option<Color>)
pub fn line_chart(&mut self, points: &[(f64, f64)], color: Option<Color>)
pub fn bar_chart(&mut self, values: &[(f64, Option<Color>)])
pub fn polygon(&mut self, vertices: &[(f64, f64)], color: Option<Color>)
pub fn pie_chart(&mut self, slices: &[(f64, Option<Color>)])
Sourcepub fn draw_circle(
&mut self,
center: (f64, f64),
radius_norm: f64,
color: Option<Color>,
)
pub fn draw_circle( &mut self, center: (f64, f64), radius_norm: f64, color: Option<Color>, )
Dibuja un círculo en coordenadas normalizadas (0.0-1.0)
Sourcepub fn plot_function<F>(
&mut self,
func: F,
min_x: f64,
max_x: f64,
color: Option<Color>,
)
pub fn plot_function<F>( &mut self, func: F, min_x: f64, max_x: f64, color: Option<Color>, )
Plotea una función matemática y = f(x)
pub fn text( &mut self, text: &str, x_norm: f64, y_norm: f64, color: Option<Color>, )
pub fn draw_axes( &mut self, x_range: (f64, f64), y_range: (f64, f64), color: Option<Color>, )
pub fn draw_grid(&mut self, divs_x: usize, divs_y: usize, color: Option<Color>)
Auto Trait Implementations§
impl Freeze for ChartContext
impl RefUnwindSafe for ChartContext
impl Send for ChartContext
impl Sync for ChartContext
impl Unpin for ChartContext
impl UnwindSafe for ChartContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more