pub struct Trendline {
pub kind: TrendlineKind,
pub name: Option<String>,
pub forward: f64,
pub backward: f64,
pub intercept: Option<f64>,
pub display_equation: bool,
pub display_r_squared: bool,
pub color: Option<Color>,
pub width: Option<f32>,
pub dash: Option<LineDash>,
}Expand description
A chart trendline (Add Chart Element ▸ Trendline, Format Trendline pane).
Fields§
§kind: TrendlineKind§name: Option<String>Custom name shown in the legend; None = automatic (“Linear (Sales)”).
forward: f64Forecast past the last point, in x units (categories on a category axis).
backward: f64Forecast before the first point, in x units.
intercept: Option<f64>Set Intercept: fixed y at x = 0 (linear, exponential, polynomial).
display_equation: bool§display_r_squared: bool§color: Option<Color>Line colour; None = the series colour.
width: Option<f32>Line width in points; None = default.
dash: Option<LineDash>Line dash; None = default.
Implementations§
Source§impl Trendline
impl Trendline
Sourcepub const MAX_FORECAST: f64 = 100_000.0
pub const MAX_FORECAST: f64 = 100_000.0
Longest forward / backward forecast kept from a file or a command, in x units. Excel’s own limit is unconfirmed; the renderer additionally bounds the forecast by the plot’s slot budget.
Sourcepub fn clamp_forecast(v: f64) -> f64
pub fn clamp_forecast(v: f64) -> f64
A forecast distance as stored: finite, not negative (NaN and infinity become 0) and at most
Self::MAX_FORECAST.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Trendline
impl<'de> Deserialize<'de> for Trendline
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Trendline
Auto Trait Implementations§
impl Freeze for Trendline
impl RefUnwindSafe for Trendline
impl Send for Trendline
impl Sync for Trendline
impl Unpin for Trendline
impl UnsafeUnpin for Trendline
impl UnwindSafe for Trendline
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