Skip to content

Commit

Permalink
[DisplayedElements] properly handle line shape
Browse files Browse the repository at this point in the history
  • Loading branch information
techfreaque committed Mar 22, 2023
1 parent 6b80f02 commit 11de29e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def _plot_graphs(self, graphs_by_parts):
size = None
if dataset[0].get(commons_enums.PlotAttributes.SHAPE.value, None) is None:
shape = None
line_shape = dataset[0].get("line_shape", None)
own_yaxis = dataset[0].get(commons_enums.PlotAttributes.OWN_YAXIS.value, False)
for data in dataset:
if x is not None:
Expand Down Expand Up @@ -209,6 +210,7 @@ def _plot_graphs(self, graphs_by_parts):
text=text,
x_type="date",
y_type=y_type,
line_shape=line_shape,
mode=data.get(commons_enums.PlotAttributes.MODE.value, None),
own_yaxis=own_yaxis,
color=color,
Expand Down Expand Up @@ -276,6 +278,7 @@ async def _get_cached_values_to_display(self, cached_value_metadata, x_shift, st
kind = cached_value_metadata[commons_enums.PlotAttributes.KIND.value]
mode = cached_value_metadata[commons_enums.PlotAttributes.MODE.value]
own_yaxis = cached_value_metadata[commons_enums.PlotAttributes.OWN_YAXIS.value]
line_shape = cached_value_metadata["line_shape"]
condition = cached_value_metadata.get("condition", None)
try:
cache_database = databases.CacheDatabase(cache_file)
Expand Down Expand Up @@ -310,6 +313,7 @@ async def _get_cached_values_to_display(self, cached_value_metadata, x_shift, st
commons_enums.PlotAttributes.KIND.value: kind,
commons_enums.PlotAttributes.MODE.value: mode,
commons_enums.PlotAttributes.OWN_YAXIS.value: own_yaxis,
"line_shape": line_shape,
})
else:
plotted_values.append({
Expand All @@ -318,6 +322,7 @@ async def _get_cached_values_to_display(self, cached_value_metadata, x_shift, st
commons_enums.PlotAttributes.KIND.value: kind,
commons_enums.PlotAttributes.MODE.value: mode,
commons_enums.PlotAttributes.OWN_YAXIS.value: own_yaxis,
"line_shape": line_shape,
})
except KeyError:
pass
Expand Down

0 comments on commit 11de29e

Please sign in to comment.