我的 xhtml 代码是:
<p:pieChart id="custom"
value="#{facturationbean.pieModelPourcentage}"
legendPosition="e"
showDataLabels="true"
title="Facturation par client en %"
rendered="#{facturationbean.isNull}" extender="ext2"
style=" width: 400px; height: 300px; font-size: medium; " />
<script>
function ext2() {
this.cfg.seriesDefaults.rendererOptions.dataLabelFormatString='%.3s%';
this.cfg.seriesDefaults.rendererOptions.dataLabelThreshold=0.5;
this.cfg.seriesDefaults.rendererOptions.dataLabelPositionFactor= 0.2;
this.cfg.seriesDefaults.rendererOptions.dataLabelCenterOn=false;
}
</script>
我怎样才能从我的图表中删除这个问题?
欢迎所有建议。
最佳答案
越简单越好:
this.cfg.seriesDefaults.rendererOptions.dataLabelThreshold=2;
我相信它只会删除所有低于 2% 的值(value)标签 ;)
实际上缺少一些代码,或者至少是 。小心 ;)
关于javascript - Primefaces饼图重叠数据标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25991753/