7

I want to create bar chart with multiple series overlapping each other.

Stack bar chart places bar on top of another bar.

I want all bar to start from the bottom like below example.

enter image description here

Is there any way to achieve this with echarts ?

Ankur Akvaliya
  • 2,989
  • 4
  • 28
  • 53
  • Is this something you are looking for - https://ibb.co/kMpYQnq – Gautam Jan 18 '20 at 12:05
  • @gautam Yes. Similar to that. It's just all bar should start from bottom. Not on top of another. – Ankur Akvaliya Jan 18 '20 at 12:29
  • You can find the example here: https://echarts.apache.org/examples/en/editor.html?c=bar-y-category-stack – Ray Jan 20 '20 at 05:07
  • @Raymond It puts bar on top of bar. For ex one bar is of value 20 & another is 30 then on chart final bar should be 30 not 20+30=50. Current example provides a way to put one bar on top of another not overlappin. – Ankur Akvaliya Jan 20 '20 at 06:22

1 Answers1

6

This example

added

series: [
    {
        name: 'Forest',
        type: 'bar',
        barGap: '-100%',  // this changed
        barCategoryGap: '80%', // this changed
        label: labelOption,
        data: [320, 332, 301, 334, 390]
    },
    {
        name: 'Steppe',
        type: 'bar',
        label: labelOption,
        data: [220, 182, 191, 234, 290]
    },
    {
        name: 'Desert',
        type: 'bar',
        label: labelOption,
        data: [150, 232, 201, 154, 190]
    },
    {
        name: 'Wetland',
        type: 'bar',
        label: labelOption,
        data: [98, 77, 101, 99, 40]
    }
]
多一点点爱
  • 1,333
  • 6
  • 12