From 868d95fb348efb5dd687c07e46c61356969db435 Mon Sep 17 00:00:00 2001 From: Ionizing Date: Tue, 27 Aug 2024 20:58:22 +0800 Subject: [PATCH 1/2] Make Bar.width to be Option --- plotly/src/traces/bar.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plotly/src/traces/bar.rs b/plotly/src/traces/bar.rs index 0acaed0d..789580b8 100644 --- a/plotly/src/traces/bar.rs +++ b/plotly/src/traces/bar.rs @@ -55,7 +55,7 @@ where legend_group_title: Option, opacity: Option, ids: Option>, - width: Option, + width: Option, offset: Option>, text: Option>, #[serde(rename = "textposition")] @@ -178,7 +178,7 @@ mod tests { .text_template("text_template") .text_template_array(vec!["text_template"]) .visible(Visible::LegendOnly) - .width(999) + .width(999.0) .x_axis("xaxis") .x_calendar(Calendar::Nanakshahi) .y_axis("yaxis") @@ -197,7 +197,7 @@ mod tests { "legendgrouptitle": {"text": "legend-group-title"}, "opacity": 0.5, "ids": ["1"], - "width": 999, + "width": 999.0, "offset": [5, 5], "text": ["text"], "textposition": ["none"], From 377b2597155a71c3fe1336eb760b7f749fddea8c Mon Sep 17 00:00:00 2001 From: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:59:49 +0200 Subject: [PATCH 2/2] make bar offset float as well - update test Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com> --- plotly/src/traces/bar.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plotly/src/traces/bar.rs b/plotly/src/traces/bar.rs index 789580b8..92ccc0b5 100644 --- a/plotly/src/traces/bar.rs +++ b/plotly/src/traces/bar.rs @@ -56,7 +56,7 @@ where opacity: Option, ids: Option>, width: Option, - offset: Option>, + offset: Option>, text: Option>, #[serde(rename = "textposition")] text_position: Option>, @@ -162,8 +162,8 @@ mod tests { .legend_group_title("legend-group-title") .marker(Marker::new()) .name("Bar") - .offset(5) - .offset_array(vec![5, 5]) + .offset(5.0) + .offset_array(vec![5.0, 5.0]) .offset_group("offset_group") .opacity(0.5) .orientation(Orientation::Vertical) @@ -198,7 +198,7 @@ mod tests { "opacity": 0.5, "ids": ["1"], "width": 999.0, - "offset": [5, 5], + "offset": [5.0, 5.0], "text": ["text"], "textposition": ["none"], "texttemplate": ["text_template"],