question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot stack bars on time x-axis

See original GitHub issue

One-line summary [问题简述]

Stacked bar charts collapsed since 4.0.3. See screenshot.

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 4.0.4
  • Browser version [浏览器类型和版本]: Chrome 64
  • OS Version [操作系统类型和版本]: macOS High Sierra

Expected behaviour [期望结果]

Bars able to stack on top of each other without overflowing issues.

ECharts option [ECharts配置项]

option = { 
  grid: {
    right: '8%',
    left: '8%'
  },
  xAxis: {
      type: 'time',
      minInterval: 1000 * 3600 * 24
  },
  yAxis: {
    type: 'value',
    min: 0,
    max: 100,
    name: '%'
  },
  series: [
  {
    type: 'bar',
    stack: 'adherence',
   data: [{
       value: ['2018-02-21', 6, 2, 33, 67]
     }],
    encode: { x: 0, y: 3 },
    barMaxWidth: 25,
    barCategoryGap: '50%',
    cursor: 'auto',
    itemStyle: {
      normal: {
        color: 'red',
        opacity: 0.5
      }
    }
  },
  {
    type: 'bar',
    stack: 'adherence',
    data: [{
       value: ['2018-02-21', 6, 2, 33, 67]
     }],
    encode: { x: 0, y: 4 },
    barMaxWidth: 25,
    barCategoryGap: '50%',
    cursor: 'auto',
    itemStyle: {
      normal: {
        color: 'green',
        opacity: 0.5
      }
    }
  }],
  dataZoom: {
    type: 'slider',
    showDataShadow: false
  }
}

Other comments [其他信息]

screen shot 2018-03-14 at 14 44 01

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:11
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
alexciesielskicommented, Sep 13, 2021

+1, we need stacking with x-axis type value

1reaction
BenoitHanottecommented, Mar 29, 2018

Same issue here, I use echarts to visualize memory consumption over time and I stack the memory usages to display the repartition of the overall memory usage. eg: heap memory + off-heap memory = total memory consumed, thus I want to stack series as in the following plot: image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot stack bars on time x-axis · Issue #7937 · apache/echarts
Currently, stack is only supported on 'category' axis. In fact, we've been considering whether support stack on 'time' or event 'value' axis, ...
Read more >
Stacked bar chart does not show bar values for time series X ...
I have some JSON data which is going to be displayed in a Stacked Bar chart using RechartJS in a ReactJS application.
Read more >
Problem with stack bars and X axis label in a Chart
Hi All, In Apex 21.2 Having this chart: Am trying to group by the last 5 years. The problem is that is also...
Read more >
Bar Chart Component - Appian 22.3
Multiple series items when stacking is NONE or null produces a set of bars for each categories item - one bar for each...
Read more >
Bar Chart - With Stacked Log Y Axis ⋅ Storybook
No Preview. Sorry, but you either have no stories or none are selected somehow. Please check the Storybook config. Try reloading the page....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found