Fix bar charts with only 1 bar are not reported correctly

This commit is contained in:
clearml 2024-10-27 22:07:01 +02:00
parent b7fb9568ef
commit 05e4e2eb4a

View File

@ -317,7 +317,7 @@ class PlotlyRenderer(Renderer):
) # TODO ditto ) # TODO ditto
if name: if name:
bar["name"] = name bar["name"] = name
if len(bar["x"]) > 1: if len(bar["x"]) >= 1:
self.msg += " Heck yeah, I drew that bar chart\n" self.msg += " Heck yeah, I drew that bar chart\n"
self.plotly_fig['data'].append(bar) self.plotly_fig['data'].append(bar)
if bar_gap is not None: if bar_gap is not None:
@ -325,7 +325,7 @@ class PlotlyRenderer(Renderer):
else: else:
self.msg += " Bar chart not drawn\n" self.msg += " Bar chart not drawn\n"
warnings.warn( warnings.warn(
"found box chart data with length <= 1, " "found box chart data with length < 1, "
"assuming data redundancy, not plotting." "assuming data redundancy, not plotting."
) )