echarts icon indicating copy to clipboard operation
echarts copied to clipboard

当坐标轴为time轴时,柱状图无法绘制

Open WebsonLeo opened this issue 10 years ago • 3 comments

问题简述 (One-line summary)

当坐标轴为time轴时,柱状图无法绘制

版本及环境 (Version & Environment)

  • ECharts 版本 (3.1.2):
  • 浏览器类型和版本 (Chrome,版本 48.0.2564.116 m):
  • 操作系统类型和版本 (windows7 专业版):

重现步骤 (Steps to reproduce)

1.将坐标轴设为time轴,series中的type改为’bar‘ 2.setOption绘制图形

期望结果 (Expected behaviour)

能够得到柱状图图形

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

对时间轴不支持

ECharts配置项 (ECharts option)

option = {
tooltip:{
        show:true,
        trigger:'axis'
    },
    xAxis : [
        {
            type : 'time',
            boundaryGap : false,
        }
    ],
    yAxis : [
        {
            type : 'value',
            axisLabel : {
                formatter: '{value} °C'
            }
        }
    ],
    series : [
        {
            name:'最高气温',
            type:'bar',
            data:[['2016-03-09 10:00',11],['2016-03-09 11:00',15]],

            markLine : {
                data : [
                    {type : 'average', name: '平均值'}
                ]
            }
        }
    ]
}

其他信息 (Other comments)

image

WebsonLeo avatar Mar 09 '16 03:03 WebsonLeo

柱状图暂时不支持时间类型的坐标轴

pissang avatar Mar 09 '16 04:03 pissang

@pissang 大概什么时候会对柱状图的时间类型进行支持呢?

WebsonLeo avatar Mar 09 '16 06:03 WebsonLeo

已提交柱状图支持 time 类型轴的代码,下个版本发布

pissang avatar Jul 09 '16 06:07 pissang