apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.25k stars 19.61k forks source link

图表container过小时,y轴会反转,强制设置inverse: false也无效 #3819

Closed collapsarzhang closed 8 years ago

collapsarzhang commented 8 years ago

问题简述 (One-line summary)

图表container过小时,y轴会反转,强制设置inverse: false也无效 fireshot capture 8 - angular 2 app i ng2-webpack - http___localhost_8080_about

版本及环境 (Version & Environment)

1. 2.

期望结果 (Expected behaviour)

可能哪里有问题 (What went wrong)

ECharts配置项 (ECharts option)

options = {
            tooltip: {
                trigger: 'axis'
            },
            // legend: {
            //     data: names,
            //     show: false
            // },
            grid: {
                show: false
            },
            xAxis: [
                {
                    type: 'category',
                    boundaryGap: false,
                    data: this.data.categories,
                    // axisLine: {
                    //     show: false
                    // },
                    // axisTick: {
                    //     show: false
                    // },
                    // axisLabel: {
                    //     show: false
                    // },
                    // splitLine: {
                    //     show: false
                    // }
                }
            ],
            yAxis: [
                {
                    type: 'value',
                    // axisLine: {
                    //     show: false
                    // },
                    // axisTick: {
                    //     show: false
                    // },
                    // axisLabel: {
                    //     show: false
                    // },
                    // splitLine: {
                    //     show: false
                    // },
                    inverse: false
                    // max: 'dataMax'
                }
            ],
            series: [
                {
                    type: 'line',
                    name: 'AAA',
                    data: [
                        [100, 300, 500, 200, 300, 500, 900]
                    ]
                }
            ]
        };

其他信息 (Other comments)

pissang commented 8 years ago

容器高度太小了,grid.top 和 grid.bottom 设成 0 或者很小的值