如何禁用Vaadin图表/Highcharts SolidGauge图表上的值工具提示?
我怎样才能摆脱这个弹出窗口/工具提示,上面写着“等待时间:3.1” 这是数据标签和打印选项的设置代码如何禁用Vaadin图表/Highcharts SolidGauge图表上的值工具提示?,highcharts,vaadin,vaadin-charts,Highcharts,Vaadin,Vaadin Charts,我怎样才能摆脱这个弹出窗口/工具提示,上面写着“等待时间:3.1” 这是数据标签和打印选项的设置代码 this.series = new ListSeries("Wait Time", 0); final PlotOptionsGauge plotOptions = new PlotOptionsGauge(); plotOptions.setTooltip(null); series.setPlotOptions(plotOpti
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);
似乎没有禁用此工具提示的setter
答案是您必须在图表配置而不是系列配置中禁用它
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);
听起来不错。Vaadin图表中的null通常意味着使用默认设置。调用
plotOptions.setTooltip(null)时代码>然后将使用标准行为,工具提示可见。