您现在的位置:首页 >> 前端 >> 内容

echarts timeline设置多个点,却只显示一个

时间:2017/1/12 10:31:51 点击:

  核心提示:echarts2 timeline 设置多个点,却只显示一个timeline :{data: [2016-10,2016-11,2016-12],lineStyle: {color: #2497be}...

echarts2 timeline 设置多个点,却只显示一个

timeline :{
    "data": [
        "2016-10",
        "2016-11",
        "2016-12"
    ],
    "lineStyle": {
        "color": "#2497be"
    },
    "controlStyle": {
        "itemSize": 20,
        "normal": {
            "color": "#2497be"
        }
    },
    "label": {
        "textStyle": {
            "color": "#2497be"
        }
    },
    "autoPlay": false,
    "currentIndex": 2,
    "playInterval": 15000
}

时间轴,显示正常。

timeline :{ 
“data”: [ 
“2016-10”, 
“2016-11”, 
“2016-12”, 
“全年” 
], 
“lineStyle”: { 
“color”: “#2497be” 
}, 
“controlStyle”: { 
“itemSize”: 20, 
“normal”: { 
“color”: “#2497be” 
} 
}, 
“label”: { 
“textStyle”: { 
“color”: “#2497be” 
} 
}, 
“autoPlay”: false, 
“currentIndex”: 2, 
“playInterval”: 15000 
}

会导致timeline 只显示一个,如果所有点不全都是正确格式时间点,可以设置type为number类型,默认模式是时间类型,时间轴间隔根据时间跨度自动计算。

Tags:EC CH HA AR 
作者:网络 来源:提拉米苏zhou的专