【问题标题】:Primefaces Pie Chart overlap data LabelPrimefaces饼图重叠数据标签
【发布时间】:2014-09-23 09:39:04
【问题描述】:

我的 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>

如何从我的图表中删除此问题?

欢迎所有建议。

【问题讨论】:

    标签: javascript jsf-2 primefaces charts


    【解决方案1】:

    越简单越好:

    this.cfg.seriesDefaults.rendererOptions.dataLabelThreshold=2;
    

    我相信它只会删除所有低于 2% 的值标签;)

    实际上缺少一些代码,或者至少缺少一个}。小心;)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-07-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多