Skip to main content

prepare_chart_data

Function prepare_chart_data 

Source
pub fn prepare_chart_data(
    lf: &LazyFrame,
    schema: &Schema,
    x_column: &str,
    y_columns: &[String],
    sampling: &ChartSampling,
    envelope: bool,
) -> Result<ChartDataResult>
Expand description

XY series from the LazyFrame, X cast to f64 (temporals as ordinals). Nulls drop per series (a null X drops the row, a null Y breaks that series’ line). Points in X order, ties in table order. With envelope, a view larger than the sample size is cut into steps, each drawing its low and high Y, keeping peaks a sample would miss; it reads twice, so only where ChartSampling::full_passes allows, stopping on ChartSampling::cancel.