From 345dcb11da72bcdaf88b9070cceccf5c06c2c270 Mon Sep 17 00:00:00 2001 From: Eduard Carrerars Date: Tue, 16 Jul 2024 15:54:14 +0200 Subject: [PATCH] Fix add valueOpts to return result --- ooui/graph/chart.py | 4 ++-- spec/graph/graph_spec.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ooui/graph/chart.py b/ooui/graph/chart.py index 1c9e4f8..96eb084 100644 --- a/ooui/graph/chart.py +++ b/ooui/graph/chart.py @@ -169,7 +169,7 @@ def process(self, values, fields, options=None): if self.type == "line" and self.y_range: y_axis_props = {'mode': self.y_range} if self.y_range == "auto": - y_axis_props.update(get_min_max(final_data)) + y_axis_props['valueOpts'] = get_min_max(final_data) result['yAxisProps'] = y_axis_props - return result \ No newline at end of file + return result diff --git a/spec/graph/graph_spec.py b/spec/graph/graph_spec.py index be6def6..96c8e7a 100644 --- a/spec/graph/graph_spec.py +++ b/spec/graph/graph_spec.py @@ -72,8 +72,10 @@ result = graph.process(values, fields) expect(result['yAxisProps']).to(equal({ 'mode': 'auto', - 'min': 8, - 'max': 32 + 'valueOpts': { + 'min': 8, + 'max': 32 + } })) with description("A line graph with y_range to full"): with it("should return yAxisProps to the result with mode full"):