2014-12-23 47 views
3

我有這張圖表,x軸的負載接近一千個時間序列點。c3js,保留x軸刻度值並刪除點

這些觀點沒有吸引力。

enter image description here

我可以隱藏x軸的,但我想在日期下面出現,減去刻度點。

有沒有辦法在離開時間的情況下刪除滴答點。 (請忽略X軸上的數字我知道他們錯了)。

最好,我想這是一個類別折線圖,並完全避免時間序列。

代碼,用刪除的數據進行簡單 -

var chart = c3.generate({ 
     padding: { 
      right: 30 
     }, 
     data: { 
      x: 'x', 
      columns: [ 
       ['x',1324252800,1324339200], 
       ['OECD Crude Oil Price',102.91,105.05]   
      ], 
      type: 'line', 
      onclick: function (d, element) { console.log("onclick", d, element); }, 
      onmouseover: function (d) { console.log("onmouseover", d); }, 
      onmouseout: function (d) { console.log("onmouseout", d); }, 
      order: null 
     }, 
     point: { 
      show: false 
     }, 
     axis: { 
      x: { 

      //show:false, 
      //I don't want this, I want to see the dates 

      type: 'timeseries', 
      tick: { 
       culling: { 
        max: 3 
       }, 
       multiline: false 
      } 
      }, 
      y: { 
      tick: { 
       format: function (d) { return "$ " + d ; } 
      } 
      } 
     }, 
     }); 

在此先感謝

回答

2

好了,哇,我傻的。我以前發現這個解決方案的問題。

Here is my answer just a fortnight ago.

捂臉。

這裏的圖表是什麼樣子,現在,與預期的效果 -

enter image description here

+0

下面是另一個例子。編輯css中的刻度線 - \t \t .tick行{ \t \t \t opacity:0; \t \t} – JasTonAChair

+0

你究竟是怎麼解決這個問題的? –