2017-08-08 41 views
0

我正在使用chart.js 2.6.0。我想隱藏工具提示插頁。我嘗試在工具提示選項中使用'caret:false',但它不起作用。我怎樣才能隱藏脫字符號?Chart.js - 隱藏工具提示插入符號

options: { 
     tooltips: { 
     caret: false, 
     }, 
     scales: { 
     yAxes: [{ 
      ticks: { 
       beginAtZero: true, 
      } 
     }] 
     } 
    } 

在此先感謝您的幫助!

回答

1

要隱藏工具提示插入符號,你需要設置caretSize屬性0工具提示,在您的圖表選項,例如:

options: { 
    tooltips: { 
     caretSize: 0 
    }, 
    ... 
} 
+0

謝謝採取!有效!! –

1

我記得使用他們一些過去。 基本上將它們關閉是將caretSize設置爲零。

// Options 
{ 
    tooltips: { 
     caretSize: 0 
    } 
} 

這裏的選項列表(雖然不完整)從repository

{ 
    enabled: true, 
    custom: null, 
    mode: 'nearest', 
    position: 'average', 
    intersect: true, 
    backgroundColor: 'rgba(0,0,0,0.8)', 
    titleFontStyle: 'bold', 
    titleSpacing: 2, 
    titleMarginBottom: 6, 
    titleFontColor: '#fff', 
    titleAlign: 'left', 
    bodySpacing: 2, 
    bodyFontColor: '#fff', 
    bodyAlign: 'left', 
    footerFontStyle: 'bold', 
    footerSpacing: 2, 
    footerMarginTop: 6, 
    footerFontColor: '#fff', 
    footerAlign: 'left', 
    yPadding: 6, 
    xPadding: 6, 
    caretPadding: 2, 
    caretSize: 5, 
    cornerRadius: 6, 
    multiKeyBackground: '#fff', 
    displayColors: true, 
    borderColor: 'rgba(0,0,0,0)', 
    borderWidth: 0 
} 
+1

謝謝!有用!! –