From 55b4e7a92c0d62673656e1786d5c20621f5833d3 Mon Sep 17 00:00:00 2001 From: Grey Date: Sat, 12 Oct 2024 15:45:12 +0800 Subject: [PATCH] markline add silent --- charming/src/element/mark_line.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/charming/src/element/mark_line.rs b/charming/src/element/mark_line.rs index fab6599..c655a61 100644 --- a/charming/src/element/mark_line.rs +++ b/charming/src/element/mark_line.rs @@ -171,6 +171,9 @@ pub struct MarkLine { #[serde(skip_serializing_if = "Option::is_none")] precision: Option, + #[serde(skip_serializing_if = "Option::is_none")] + silent: Option, + #[serde(skip_serializing_if = "Vec::is_empty")] data: Vec, } @@ -190,6 +193,7 @@ impl MarkLine { z: None, symbol: vec![], precision: None, + silent: None, data: vec![], } } @@ -224,6 +228,11 @@ impl MarkLine { self } + pub fn silent(mut self, silent: bool) -> Self { + self.silent = Some(silent); + self + } + pub fn data>(mut self, data: Vec) -> Self { self.data = data.into_iter().map(|m| m.into()).collect(); self