2016-08-31 6 views
0

私はハイチャート縦棒グラフに変換しようとしているテーブルを持っていて、縦線の設定には小さな問題があります。縦棒グラフの縦線位置を変更する

私は、列ブロックの各セットの間に配置します。画像

enter image description here

<table id="datatable"> 
    <thead> 
     <tr> 
      <th></th> 
      <th>Daily Sales</th> 
      <th>Average</th> 
     </tr> 
    </thead> 
    <tbody> 
     <tr> 
      <th>2000</th> 
      <td>100</td> 
      <td>200</td> 
     </tr> 
     <tr> 
      <th>2005</th> 
      <td>245</td> 
      <td>300</td> 
     </tr> 
     <tr> 
      <th>2010</th> 
      <td>10</td> 
      <td>500</td> 
     </tr> 


    </tbody> 
</table> 

そして、私のhighchartsコード

$('#chart').highcharts({ 
       data: { 
        table: 'datatable' 
       }, 
       exporting: { enabled: false }, 
       chart: { 
        type: 'column', 


       }, 
       title: { 
        text: '' 
       }, 

       labels: { 
        format: '{value}' 
       }, 
       yAxis: { 
        allowDecimals: false, 

        title: { 
         text: 'Chart' 
        } 
       }, 
       xAxis: { 
        gridLineWidth: 1, 
        gridLineColor: '#000', 
        lineColor: '#000', 
        lineWidth: 1, 
        crosshair: true, 



       }, 
       colors: [ 
         '#990000', 
         '#993399', 

        ], 
       legend: { 

        align: 'left', 
        verticalAlign: 'top', 

       }, 
       linearGradient: { 
        x1: 0, 
        y1: 0, 
        x2: 1, 
        y2: 0 
       }, 

        }, 
      }); 
     }); 

でご確認くださいすべてのヘルプはあなたがwhiich、tickmarkPlacementパラメータの値 'の間' を設定する必要があり

+0

。例:http://jsfiddle.net/r9rzfm2s/ –

+0

@SebastianBochan私はそれを試しましたが、xAxisで数年のように数字を使用すると、それはうまく動作しません。 http://jsfiddle.net/5m3kgkvs/3/ – LiveEn

+1

を確認してください。最初は、以前の値ではなく値の間に設定する必要があります。 tickmarkPlacementはカテゴリのみで動作します。固定デモ:http://jsfiddle.net/555jex1q/ –

答えて

1

を理解されるであろうカテゴリのみで動作します。

xAxis: { 
    type: 'category', 
    gridLineWidth: 1, 
    tickmarkPlacement: 'between' 
} 

固定デモ: 'と' として[tickmarkPlacement(http://api.highcharts.com/highcharts/xAxis.tickmarkPlacement)パラメータを設定し

関連する問題