khaled Rihane
khaled Rihane

Reputation: 626

Primefaces Pie Chart overlap data Label

my xhtml code is :

<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 picture show the overlap of data labels

How can i remove this issue from my chart?

All suggestion are welcome.

Upvotes: 2

Views: 1877

Answers (1)

Hotted24
Hotted24

Reputation: 512

Simpler is better :

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

I believe it will just delete every value label lower than 2% ;)

Actually there's some code missing, or at least a }. Be careful ;)

Upvotes: 1

Related Questions