echarts icon indicating copy to clipboard operation
echarts copied to clipboard

stacked column behavior is strange when the data range is too small.

Open katherinebai opened this issue 7 years ago • 4 comments

Using the following option, the echart behavior is so strange as picture: image

option = { "legend": { "show": true, "data": ["s1", "s2"] }, "series": [{ "name": "s1", "z": 3, "type": "bar", "data": [{ "value": 0.990566 }, { "value": 0.9756098 }, { "value": 0.9868421 }, { "value": 0.9879518 }], "itemStyle": { "color": "#4F81BD" }, "stack": "s1" }, { "name": "s2", "z": 2, "type": "bar", "data": [{ "value": 0.009434 }, { "value": 0.0243902 }, { "value": 0.0131579 }, { "value": 0.0120482 }], "itemStyle": { "color": "#C0504D" }, "stack": "s1" }], "xAxis": { "show": true, "type": "category", "data": ["a", "b", "c", "d"] }, "yAxis": { "show": true, "type": "value", "max": 1, "min": 0.96, "splitNumber": 8 } };

katherinebai avatar Dec 21 '18 06:12 katherinebai

I have fixed some error in your demo and reproduce a new one, you can see this URL.

deqingli avatar Dec 21 '18 11:12 deqingli

image I can't see your fixed demo.

katherinebai avatar Dec 22 '18 01:12 katherinebai

This is the new option, you can try it.

option = {
    
    legend: {
        show: true,
        data: ["s1", "s2"]
    },
    "series": [
        {
            "name": "s1",
            // "z": 3,
            "type": "bar",
            "data": [
                {
                    "value": 0.990566
                }, 
                {
                    "value": 0.9756098
                }, 
                {
                    "value": 0.9868421
                }, 
                {
                    "value": 0.9879518
                }
            ],
            "itemStyle": {
                "color": "#4F81BD"
            },
            "stack": "total"
        }, 
        {
            "name": "s2",
            // "z": 2,
            "type": "bar",
            "data": [{
            "value": 0.009434
            }, {
            "value": 0.0243902
            }, {
            "value": 0.0131579
            }, {
            "value": 0.0120482
            }],
            "itemStyle": {
            "color": "#C0504D"
            },
            "stack": "total"
        }
    ],
    "xAxis": {
        "show": true,
        "type": "category",
        "data": ["a", "b", "c", "d"]
    },
    "yAxis": {
        "show": true,
        "type": "value",
        // "max": 1,
        // "min": 0.96,
        "splitNumber": 8
    }
};

deqingli avatar Dec 24 '18 03:12 deqingli

Thank you.

katherinebai avatar Dec 24 '18 06:12 katherinebai