鍍金池/ 問答/HTML5  HTML/ 關于echarts畫圖,當Y軸設置為category,在series選擇了狀態(tài),

關于echarts畫圖,當Y軸設置為category,在series選擇了狀態(tài),但不顯示圖像

option = {

title : {
    text: '司機駕駛狀態(tài)',
    subtext: '實時'
},
tooltip : {
    trigger: 'axis'
},
legend: {
    data:['狀態(tài)']
},
toolbox: {},
calculable : true,
xAxis : [
    {
        type : 'category',
        boundaryGap : false,
        data : ['12:00','12:01','12:02','12:03','12:04','12:05','12:06','12:07','12:08','12:09','12:10','12:11']
    }
],
yAxis : [
    {
      type : 'category',
        boundaryGap : false,
        data:['清醒','疲勞','非常疲勞']
    }
],
series : [
    {
        name:'狀態(tài)',
        type:'line',
        smooth:true,
        itemStyle: {normal: {areaStyle: {type: 'default'}}},
        data:['疲勞','清醒','清醒','清醒','疲勞','非常疲勞','疲勞','清醒','清醒','清醒','清醒','疲勞']
    },
]

};
這是代碼,附上圖像

clipboard.png
為何沒有狀態(tài)的圖

回答
編輯回答
哎呦喂

y軸應為數(shù)值

2017年5月13日 23:34