openpine_vm/visuals/
bar_colors.rs1use openpine_compiler::instructions::Color;
2use serde::{Deserialize, Serialize};
3
4use crate::{series::Series, visuals::PlotDisplay};
5
6#[derive(Debug, Clone, Serialize, Deserialize)]
8pub struct BarColors {
9 pub colors: Series<Option<Color>>,
11 pub offset: i32,
13 pub editable: bool,
15 pub show_last: Option<usize>,
17 pub title: Option<String>,
19 pub display: PlotDisplay,
21}
22
23impl Default for BarColors {
24 fn default() -> Self {
25 Self {
26 colors: Series::new(),
27 offset: 0,
28 editable: true,
29 show_last: None,
30 title: None,
31 display: PlotDisplay::ALL,
32 }
33 }
34}
35
36impl BarColors {
37 pub(crate) fn append_new(&mut self) {
38 self.colors.append_new();
39 }
40}