最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - morris.js Multiple stacked bars on single label - Stack Overflow

programmeradmin1浏览0评论

I'm curious if morris.js supports having multiple stacked bars on single label and if someone knows workaround.

I want to have 2 graphs stacked together on same line. Blue and red should be on top each other and green and yellow.

Morris.Bar({
    element: 'daily_revenue',
    data: [],
    xkey: 'label',
    ykeys: ['inbound_netto', 'inbound_brutto', 'outbound_netto', 'outbound_brutto'],
    labels: ['Inbound Netto', 'Inbound Brutto', 'Outbound Netto', 'Outbound Brutto'],
    resize: true,
    barColors: ["#B21516", "#1531B2", "#1AB244", "#B29215"],
    hideHover: true
});

Thank you.

I'm curious if morris.js supports having multiple stacked bars on single label and if someone knows workaround.

I want to have 2 graphs stacked together on same line. Blue and red should be on top each other and green and yellow.

Morris.Bar({
    element: 'daily_revenue',
    data: [],
    xkey: 'label',
    ykeys: ['inbound_netto', 'inbound_brutto', 'outbound_netto', 'outbound_brutto'],
    labels: ['Inbound Netto', 'Inbound Brutto', 'Outbound Netto', 'Outbound Brutto'],
    resize: true,
    barColors: ["#B21516", "#1531B2", "#1AB244", "#B29215"],
    hideHover: true
});

Thank you.

Share Improve this question edited Nov 6, 2015 at 13:35 TayTay 7,1905 gold badges46 silver badges69 bronze badges asked Nov 6, 2015 at 13:26 TadejTadej 111 silver badge3 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

I don't think it's possible with the latest Morris.js version (0.5.1).
You can set the stacked parameter to true in your Morris.Bar configuration, but for only one stacked bar for each label:

stacked: true

Morris charts samples

发布评论

评论列表(0)

  1. 暂无评论