小编Geo*_*ani的帖子

如何使echart X轴类型的时间显示一天的时间段

我正在使用echarts,尝试使echarts在x轴上显示一天的时间段时遇到问题。这是我的代码

this.area = {
    color: ["#009C95","#21ba45"],
    title : {
        text: 'Fuel History',
        textStyle: {
            fontFamily: 'lato'
        }
    },
    tooltip : {
        trigger: 'axis'
    },
    calculable : true,
    xAxis : [
        {
            type: 'time',
            boundaryGap:false,
            axisLabel: {
                formatter: (function(value){
                    return moment(value).format('HH:mm');
                })
            },
            data : dates
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : [
        {
            backgroundColor: '#4D86FF',
            name:'Refuelling',
            type:'line',
            smooth:true,
            itemStyle: {normal: {areaStyle: {type: 'default'}}},
            data: historyRefuelling
        },
        {
            name:'Fuel Theft',
            type:'line',
            smooth:true,
            itemStyle: {normal: …
Run Code Online (Sandbox Code Playgroud)

javascript charts echarts baidu

1
推荐指数
1
解决办法
8146
查看次数

标签 统计

baidu ×1

charts ×1

echarts ×1

javascript ×1