Skip to content

Commit

Permalink
markline add silent
Browse files Browse the repository at this point in the history
  • Loading branch information
yg0x01 committed Oct 12, 2024
1 parent 75d6573 commit 55b4e7a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions charming/src/element/mark_line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ pub struct MarkLine {
#[serde(skip_serializing_if = "Option::is_none")]
precision: Option<f64>,

#[serde(skip_serializing_if = "Option::is_none")]
silent: Option<bool>,

#[serde(skip_serializing_if = "Vec::is_empty")]
data: Vec<MarkLineVariant>,
}
Expand All @@ -190,6 +193,7 @@ impl MarkLine {
z: None,
symbol: vec![],
precision: None,
silent: None,
data: vec![],
}
}
Expand Down Expand Up @@ -224,6 +228,11 @@ impl MarkLine {
self
}

pub fn silent(mut self, silent: bool) -> Self {
self.silent = Some(silent);
self
}

pub fn data<M: Into<MarkLineVariant>>(mut self, data: Vec<M>) -> Self {
self.data = data.into_iter().map(|m| m.into()).collect();
self
Expand Down

0 comments on commit 55b4e7a

Please sign in to comment.