Projet

Général

Profil

0001-dataviz-keep-more-of-legend-labels-unless-narrow-cel.patch

Frédéric Péters, 01 novembre 2019 13:01

Télécharger (1,16 ko)

Voir les différences:

Subject: [PATCH] dataviz: keep more of legend labels (unless narrow cell)
 (#37347)

 combo/apps/dataviz/models.py | 3 +++
 1 file changed, 3 insertions(+)
combo/apps/dataviz/models.py
233 233
        chart.x_labels = x_labels
234 234

  
235 235
        chart.show_legend = bool(len(response['axis']) > 1)
236
        chart.truncate_legend = 30
236 237
        # matplotlib tab10 palette
237 238
        chart.config.style.colors = (
238 239
                '#1f77b4', '#ff7f0e', '#2ca02c', '#d62728',
......
259 260
                    continue
260 261
                chart.add(label, value)
261 262
            chart.show_legend = True
263
            if width and width < 500:
264
                chart.truncate_legend = 15
262 265

  
263 266
        if response.get('unit') == 'seconds':
264 267
            def format_duration(value):
265
-