是否可以在3D饼图中隐藏空工具提示?

时间:2019-04-23 11:25:28

标签: amcharts amcharts4

我正在尝试将3d Pie中的html工具提示隐藏为空,就像这张图片一样:

enter image description here

当我单击图例时,工具提示将被填充,如下所示:

enter image description here

var series = chart.series.push(new am4charts.PieSeries3D());
series.dataFields.value = "litres";

series.numberFormatter = new am4core.NumberFormatter();
series.numberFormatter.numberFormat = "#.###,##";

series.dataFields.category = "country";
series.slices.template.propertyFields.url = "url";
series.slices.template.urlTarget = "_blank";

series.slices.template.stroke = am4core.color("#fff");
series.slices.template.strokeWidth = 2;
series.slices.template.strokeOpacity = 1;                

series.tooltip.pointerOrientation = "vertical"; 
series.tooltipHTML = `<center><strong>{country}</strong></center>
<hr />
<table>
<tr>
  <th align="left">Litri</th>
  <td>{litres}</td>
</tr>
<tr>
  <th align="left">Ultimo aggiornamento</th>
  <td>{ultimoaggiornamento}</td>
</tr>
</table>
<hr />`;

0 个答案:

没有答案