2017-05-24 4 views
0

私は隣接するバーの間にスペースがなければならないchartjsでbarchartを構築しようとしています。私が持っている問題は、私はバーの間の境界を取り除くないということです。 Bars with bordersChartjs境界なしのBarchart

これは私の設定です:

new Chart($('#weekly-availabilities-chart'), { 
    type: 'bar', 
    data: { 
    labels: ..., 
    datasets: [ 
    { 
     backgroundColor: 'rgba(153, 193, 72, 0.4)', 
     label: 'label a', 
     borderWidth: 0, 
     data: dataset_1 
    }, { 
     backgroundColor: 'rgba(13, 39, 73, 0.4)', 
     label: 'label b', 
     borderWidth: 0, 
     data: dataset_2 
    } 
    ] 
}, 
    options: { 
    scales: { 
    xAxes: [ 
     { 
     barPercentage: 1, 
     categoryPercentage: 1, 
     gridLines: { 
      display: false 
     } 
     } 
    ], 
    yAxes: [ 
     { 
     stacked: true, 
     gridLines: { 
      color: 'rgba(0,0,0,0.05)' 
     }, 
     ticks: { 
      beginAtZero: true, 
      max: 40 
     } 
     } 
    ] 
    } 
} 
}); 
+0

これを確認してください。https://jsfiddle.net/07pzys9t/2/ –

答えて

0

あなたのデータセットでborderWidth: 0を使用しています。

datasets: [ 
    { 
    backgroundColor: 'rgba(153, 193, 72, 0.4)', 
    label: 'label a', 
    data: dataset_1, 
    borderWidth: 0 
    }, { 
    backgroundColor: 'rgba(13, 39, 73, 0.4)', 
    label: 'label b', 
    data: dataset_2, 
    borderWidth: 0 
    } 
] 
+1

私は試しましたが、効果はありません。私はこのオプションを含む質問を更新します。 – Peet

+0

あなたは解決策を見つけましたか? –