mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
fix: bar chart issue with duplicate x-axis labels being incorrectly ignored (#10134)
Co-authored-by: liusurong.lsr <liusurong.lsr@alibaba-inc.com>
This commit is contained in:
parent
dad041c49f
commit
805c701767
|
@ -33,7 +33,9 @@ class BarChartTool(BuiltinTool):
|
|||
if axis:
|
||||
axis = [label[:10] + "..." if len(label) > 10 else label for label in axis]
|
||||
ax.set_xticklabels(axis, rotation=45, ha="right")
|
||||
ax.bar(axis, data)
|
||||
# ensure all labels, including duplicates, are correctly displayed
|
||||
ax.bar(range(len(data)), data)
|
||||
ax.set_xticks(range(len(data)))
|
||||
else:
|
||||
ax.bar(range(len(data)), data)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user