Skip to main content

nominal_api/conjure/objects/themes/api/
chart_theme_content_v1.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct ChartThemeContentV1 {
16    #[serde(rename = "titleEnabled")]
17    title_enabled: bool,
18    #[serde(rename = "titleAlignment")]
19    title_alignment: super::TextAlignment,
20    #[serde(rename = "titleFontSize")]
21    title_font_size: i32,
22    #[serde(rename = "titleFontColor")]
23    title_font_color: super::HexColor,
24    #[serde(rename = "captionEnabled")]
25    caption_enabled: bool,
26    #[serde(rename = "captionAlignment")]
27    caption_alignment: super::TextAlignment,
28    #[serde(rename = "captionFontSize")]
29    caption_font_size: i32,
30    #[serde(rename = "captionFontColor")]
31    caption_font_color: super::HexColor,
32    #[serde(rename = "backgroundEnabled")]
33    background_enabled: bool,
34    #[serde(rename = "legendEnabled")]
35    legend_enabled: bool,
36    #[serde(rename = "legendPosition")]
37    legend_position: super::LegendPosition,
38    #[serde(rename = "legendFontSize")]
39    legend_font_size: i32,
40    #[serde(rename = "legendFontColor")]
41    legend_font_color: super::HexColor,
42    #[serde(rename = "legendPlacement")]
43    legend_placement: super::LegendPlacement,
44    #[serde(rename = "rowGapEnabled")]
45    row_gap_enabled: bool,
46    #[builder(default, into)]
47    #[serde(rename = "rowGapSize", skip_serializing_if = "Option::is_none", default)]
48    row_gap_size: Option<i32>,
49    #[serde(rename = "aspectRatioWidth")]
50    aspect_ratio_width: i32,
51    #[serde(rename = "aspectRatioHeight")]
52    aspect_ratio_height: i32,
53    #[builder(custom(type = super::ChartTypeThemes, convert = Box::new))]
54    #[serde(rename = "chartTypeThemes")]
55    chart_type_themes: Box<super::ChartTypeThemes>,
56}
57impl ChartThemeContentV1 {
58    /// Whether to show a title in the export.
59    #[inline]
60    pub fn title_enabled(&self) -> bool {
61        self.title_enabled
62    }
63    /// How to align the text of the title.
64    #[inline]
65    pub fn title_alignment(&self) -> &super::TextAlignment {
66        &self.title_alignment
67    }
68    /// Font size of the title.
69    #[inline]
70    pub fn title_font_size(&self) -> i32 {
71        self.title_font_size
72    }
73    /// Font color of the title.
74    #[inline]
75    pub fn title_font_color(&self) -> &super::HexColor {
76        &self.title_font_color
77    }
78    /// Whether to show a caption in the export.
79    #[inline]
80    pub fn caption_enabled(&self) -> bool {
81        self.caption_enabled
82    }
83    /// How to align the text of the caption.
84    #[inline]
85    pub fn caption_alignment(&self) -> &super::TextAlignment {
86        &self.caption_alignment
87    }
88    /// Font size of the caption.
89    #[inline]
90    pub fn caption_font_size(&self) -> i32 {
91        self.caption_font_size
92    }
93    /// Font color of the caption.
94    #[inline]
95    pub fn caption_font_color(&self) -> &super::HexColor {
96        &self.caption_font_color
97    }
98    /// Whether to include a default background with the export.
99    /// (`false` indicates that the background should be transparent)
100    #[inline]
101    pub fn background_enabled(&self) -> bool {
102        self.background_enabled
103    }
104    /// Whether to include a legend in the export.
105    #[inline]
106    pub fn legend_enabled(&self) -> bool {
107        self.legend_enabled
108    }
109    /// Which side the legend should appear on.
110    #[inline]
111    pub fn legend_position(&self) -> &super::LegendPosition {
112        &self.legend_position
113    }
114    /// Font size of the legend.
115    #[inline]
116    pub fn legend_font_size(&self) -> i32 {
117        self.legend_font_size
118    }
119    /// Font color of the legend.
120    #[inline]
121    pub fn legend_font_color(&self) -> &super::HexColor {
122        &self.legend_font_color
123    }
124    /// Where on the chart the legend should be placed.
125    #[inline]
126    pub fn legend_placement(&self) -> &super::LegendPlacement {
127        &self.legend_placement
128    }
129    /// Whether rows will be separated.
130    #[inline]
131    pub fn row_gap_enabled(&self) -> bool {
132        self.row_gap_enabled
133    }
134    /// The size of the row gap.
135    #[inline]
136    pub fn row_gap_size(&self) -> Option<i32> {
137        self.row_gap_size.as_ref().map(|o| *o)
138    }
139    /// The relative width of the chart export.
140    #[inline]
141    pub fn aspect_ratio_width(&self) -> i32 {
142        self.aspect_ratio_width
143    }
144    /// The relative height of the chart export.
145    #[inline]
146    pub fn aspect_ratio_height(&self) -> i32 {
147        self.aspect_ratio_height
148    }
149    /// Theme parameters specific to chart types.
150    #[inline]
151    pub fn chart_type_themes(&self) -> &super::ChartTypeThemes {
152        &*self.chart_type_themes
153    }
154}