莫里斯js隐藏ykey但显示标签

时间:2018-06-27 11:23:48

标签: javascript django-templates morris.js

我有一个Morris条形图,我想在图表中隐藏“ b”,但在图例中显示标签。有可能这样做吗?

Morris.Bar({
    element: 'transactions',
    data: [
        {% for transaction in transactions %}
            {
                y: '{{ transaction.0|date:'d-m-Y' }}',
                a: {{ transaction.1 }},
                b: {{ transaction.2 }}
            },
        {% endfor %}
    ],
    xkey: 'y',
    ykeys: ['a', 'b'],
    labels: ['Count', 'Sum'],
    resize: true,
    hideHover: true,
    lineColors: ['#33414E', '#95B75D'],
    xLabelAngle: 40,
});

0 个答案:

没有答案