为什么x轴刻度不显示?

时间:2017-02-28 11:16:47

标签: charts jsfiddle c3.js

为什么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 个答案:

答案 0 :(得分: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']
    },
    .....