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.

Stacked line chart with negative values

See original GitHub issue

One-line summary [问题简述]

When i have a line with some negative values (e.g. [3, 1, 2, -1, -3, 1, 3]) and my stack is always 1, i want that the stack also work for “-1” and “-3”.

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 4
  • Browser version: all browsers
  • OS Version: all OS

ECharts option [ECharts配置项]

option = {
    xAxis : [
        {
            type: 'category',
        		data: [1,2,3,4,5,6,7,8,9]
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : [
        {
            name:'stack',
            type:'line',
            stack: 'stack',
            data:[3, 1, 2, -1, -3, 1, 3]
        },
        {
            name:'stack',
            type:'line',
            stack: 'stack',
            areaStyle: {},
            data:[1, 1, 1, 1, 1, 1, 1]
        }
    ]
};

Expected behaviour [期望结果]

I get the following result with the option above.

image

But i would expect something like this: image

Other comments [其他信息]

Example of the bug https://jsfiddle.net/ykb5n0pa/

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
villebrocommented, May 23, 2022

Here’s the proposed fix PR: #17086

2reactions
villebrocommented, Feb 2, 2022

@pissang Perfect, I’ll get to work on it right away!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating a stacked area chart which shows negative values
Using this data I have created a stacked column chart to represent the profit values in the various columns through time. Time will...
Read more >
How to Create Stacked Area Chart with Negative Values in ...
In this article, we have illustrated 3 easiest examples to plot stacked area chart with negative values in Excel.
Read more >
Stacked area chart with negative values - Highcharts
When negative and positive values are both rendered from 0 it creates large peaks and valleys in the chart that make individual values...
Read more >
Stacked Column Chart with Negative Values - AnyChart
Stacked Column chart with negative values shows loss and profit from selling several products in several states. Stacked mode helps to compare the ......
Read more >
Stacked Area Chart - Negative Values - Excel Help Forum
Use a normal area chart and calculate new stacked values. You may need to alter the order of the series so the final...
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