2017-02-28 161 views
0

爲什麼X軸不顯示刻度或刻度文本?爲什麼x軸刻度不顯示?

https://jsfiddle.net/horacebury/2vc606wx/

我覺得有什麼錯在這裏,但不知道是什麼:

axis: { 
    x: { 
    type: 'timeseries', 
    tick: { 
     format: '%H:%M', 
     //count: 17, 
     //fit: true, 
     values: ['00:00','01:30','03:00','04:30','06:00','07:30','09:00','10:30','12:00','13:30','15:00','16:30','18:00','19:30','21:00','22:30','00:00'] 
    }, 

回答

1

axis.x.tick.format是用於顯示刻度的格式,解析axis.x.tick.values格式可以被指定爲data.xFormat

data: { 
    x: 'x', 
    xFormat: '%d/%m/%Y %H:%M', 
    columns: [c3dates, c3originals, c3data], 
    names: { 
     data1: 'Power: 21 February', 
     data2: 'Originals' 
    }, 
    types: c3types, 
    axes: { 
     data2: 'y', 
     data2: 'y2' 
    } 
}, 
axis: { 
    x: { 
     type: 'timeseries', 
     tick: { 
      format: '%H:%M', 
      values: ['21/02/2017 01:00'] 
    }, 
    ..... 
+0

我不能得到這個工作:https://jsfiddle.net/horacebury/2vc606wx/ –

+1

@MattW - 值/格式中的日期部分似乎是必不可少的... – ewcz

+0

Works:https://jsfiddle.net/horacebury/2vc606wx/ –