dataviz: keep more of legend labels (unless narrow cell) (#37347)
This commit is contained in:
parent
fcafb76803
commit
b6443edfa3
|
@ -236,6 +236,7 @@ class ChartNgCell(CellBase):
|
|||
chart.x_labels = x_labels
|
||||
|
||||
chart.show_legend = bool(len(response['axis']) > 1)
|
||||
chart.truncate_legend = 30
|
||||
# matplotlib tab10 palette
|
||||
chart.config.style.colors = (
|
||||
'#1f77b4', '#ff7f0e', '#2ca02c', '#d62728',
|
||||
|
@ -262,6 +263,8 @@ class ChartNgCell(CellBase):
|
|||
continue
|
||||
chart.add(label, value)
|
||||
chart.show_legend = True
|
||||
if width and width < 500:
|
||||
chart.truncate_legend = 15
|
||||
|
||||
if response.get('unit') == 'seconds' or response.get('measure') == 'duration':
|
||||
def format_duration(value):
|
||||
|
|
Loading…
Reference in New Issue