2017-02-15 26 views
0

我用圖表JS的選項:如何去除填充圖JS

options: { 
    scales: { 
     xAxes: [{ 
     ticks: { 
      autoSkip: false, 
      beginAtZero: true, 
      min: 0, 
      beginAtZero: true, 
     }, 
     }], 
     yAxes: [{ 
     ticks: { 
      beginAtZero: true, 
      min: 0, 
      beginAtZero: true, 
     }, 
     }] 
    } 
    } 

如何刪除此填充? 我無法在文檔中找到此選項。

enter image description here

+2

我敢肯定的URL文本是造成這個問題,你應該使用更短的文字。另外,如果你添加一個plunker演示,我相信你的問題會得到更快的回答。 –

+0

謝謝你,你是對的。 –

回答

2

可以使用minRotationtickmaxRotation改變標籤的天使:

options: { 
    scales: { 
    xAxes: [{ 
     ticks: { 
     minRotation: 90 // angle in degrees 
     } 
    }] 
    } 
} 
1

的襯墊是由於第一標籤。如果你減少標籤,一切都會工作得很好。因爲畫布元素必須填充所提供的空間,並且不能超出畫布大小。