echarts icon indicating copy to clipboard operation
echarts copied to clipboard

Stacked Bars Mismatch

Open DavidDecraene opened this issue 8 years ago • 2 comments

One-line summary

Version & Environment

  • ECharts version 4.0.2
  • Browser version Chrome
  • OS Version MacOs Sierra

Expected behaviour

Two data series, simple sequences (x values from 0 to 10, y values random between 0 and 10)

X and Y values do not stack properly (mismatches, skips an x value entry) Additionally, first bar overlays the y axis

ECharts option [ECharts配置项]

option = {
  "color": [
    "#A18535",
    "#0066AA",
    "#374C59",
    "#5B91B3",
    "#3C5937",
    "#6CA43B",
    "#fdbf6f",
    "#ff7f00",
    "#cab2d6",
    "#6a3d9a",
    "#ffff99",
    "#b15928"
  ],
  "yAxis": [
    {
      "type": "value",
      "splitLine": {
        "show": false
      },
      "axisLine": {
        "show": false
      }
    }
  ],
  "xAxis": [
    {
      "type": "value",
      "splitLine": {
        "show": true
      }
    }
  ],
  "series": [
    {
      "data": [
        {
          "value": [
            0,
            6
          ]
        },
        {
          "value": [
            1,
            7
          ]
        },
        {
          "value": [
            2,
            7
          ]
        },
        {
          "value": [
            3,
            6
          ]
        },
        {
          "value": [
            4,
            5
          ]
        },
        {
          "value": [
            5,
            4
          ]
        },
        {
          "value": [
            6,
            3
          ]
        },
        {
          "value": [
            7,
            1
          ]
        },
        {
          "value": [
            8,
            4
          ]
        },
        {
          "value": [
            9,
            5
          ]
        },
        {
          "value": [
            10,
            6
          ]
        }
      ],
      "lineStyle": {
        "width": 1
      },
      "name": "predicted",
      "type": "bar",
      "showSymbol": false,
      "stack": "stack0"
    },
    {
      "data": [
        {
          "value": [
            0,
            5
          ]
        },
        {
          "value": [
            1,
            6
          ]
        },
        {
          "value": [
            2,
            3
          ]
        },
        {
          "value": [
            3,
            4
          ]
        },
        {
          "value": [
            4,
            5
          ]
        },
        {
          "value": [
            5,
            4
          ]
        },
        {
          "value": [
            6,
            3
          ]
        },
        {
          "value": [
            7,
            2
          ]
        },
        {
          "value": [
            8,
            3
          ]
        },
        {
          "value": [
            9,
            6
          ]
        },
        {
          "value": [
            10,
            7
          ]
        }
      ],
      "lineStyle": {
        "width": 1
      },
      "name": "actual",
      "type": "bar",
      "showSymbol": false,
      "stack": "stack0"
    }
  ],
  "dataZoom": [
    {
      "disabled": false,
      "type": "inside"
    }
  ],
  "legend": [
    {
      "show": true,
      "data": [
        "predicted",
        "actual"
      ]
    }
  ]
};

screen shot 2018-01-31 at 15 01 33

DavidDecraene avatar Jan 31 '18 14:01 DavidDecraene

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] avatar Sep 22 '21 21:09 github-actions[bot]

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

github-actions[bot] avatar Sep 29 '21 21:09 github-actions[bot]