2017-09-28 28 views
1

我該如何擺脫這種彈出窗口/工具提示「Wait Time:3.1」?如何禁用Vaadin-Charts/Highcharts SolidGauge圖表上的值工具提示?

這裏是

 this.series = new ListSeries("Wait Time", 0); 
     final PlotOptionsGauge plotOptions = new PlotOptionsGauge(); 
     plotOptions.setTooltip(null); 
     series.setPlotOptions(plotOptions); 
     final DataLabels dataLabels = new DataLabels(); 
     dataLabels.setEnabled(false); 
     plotOptions.setDataLabels(dataLabels); 
     configuration.setSeries(series); 

似乎沒有要禁用此提示二傳手數據標籤的繪圖和

我的設置代碼。

enter image description here

回答

3

答案是你必須在圖表配置不是該系列配置

   final Configuration configuration = gaugeChart.getConfiguration(); 
       configuration.getChart().setType(ChartType.GAUGE); 
       configuration.getChart().setPlotBackgroundColor(null); 
       configuration.getChart().setPlotBackgroundImage(null); 
       configuration.getChart().setPlotBorderWidth(0); 
       configuration.getChart().setPlotShadow(false); 
       configuration.setTitle(""); 

       /* This line removes the tooltip */ 
       configuration.getTooltip().setEnabled(false); 
+2

這聽起來是正確禁用它。 Vaadin中的null通常表示使用默認設置。當你調用'plotOptions.setTooltip(null);'它會使用標準的行爲,它的工具提示可見。 –