Customize primefaces chart

When you use extender you can change everything by js.

Here is an example

<p:lineChart ... extender="chartExtender"/>

And on js file or in the page under Tag:

function chartExtender() {        
 // this = chart widget instance        
 // this.cfg = options        
 this.cfg.grid = {             
        background: 'transparent',
         gridLineColor: '#303030',
         drawBorder: false,
    };
  }

This is just an example.. This will help you to do the rest.

For more recent PF versions, check What is the alternative for the chart extender attribute in PrimeFaces 5.2 and newer
Hope that helps 🙂

Leave a Comment