From 7bfae550265a31bef21d3a2e8dbf2132cd3d0062 Mon Sep 17 00:00:00 2001 From: Ionizing <17506747+Ionizing@users.noreply.github.com> Date: Fri, 6 Sep 2024 19:48:02 +0800 Subject: [PATCH] Make Bar.width to be Option (#230) * Make Bar.width to be Option * make bar offset float as well - update test Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com> --------- Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com> Co-authored-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com> --- plotly/src/traces/bar.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plotly/src/traces/bar.rs b/plotly/src/traces/bar.rs index 0acaed0d..92ccc0b5 100644 --- a/plotly/src/traces/bar.rs +++ b/plotly/src/traces/bar.rs @@ -55,8 +55,8 @@ where legend_group_title: Option, opacity: Option, ids: Option>, - width: Option, - offset: Option>, + width: 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) @@ -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,8 +197,8 @@ mod tests { "legendgrouptitle": {"text": "legend-group-title"}, "opacity": 0.5, "ids": ["1"], - "width": 999, - "offset": [5, 5], + "width": 999.0, + "offset": [5.0, 5.0], "text": ["text"], "textposition": ["none"], "texttemplate": ["text_template"],