Vertical grid disable not working with PrimeFaces 5.2

554 views Asked by At

I'm using PrimeFaces 5.2 and JSF. I tried to create line-chart and used extender attribute to customize the grids. Now am trying for disable vertical line but its not working.

My XHTML:

<p:chart type="line"
         model="#{chartViewLine.lineModel1}"
         styleClass="legendpos"
         extender="chartExtender"
         style="height:300px; width:570px;"/>

JavaScript :

function chartExtender() {

        this.cfg.grid = {             
                background: '#ffffff',
                 gridLineColor: '#eaeaea',
                 drawBorder: false,
                 borderColor: 'red',     
                    borderWidth: 3.0,          
                    shadow: false,
            };

    }`this.cfg.axes = {
                xaxis: {
                    ticks: ticks,
                    tickOptions: {"scaleShowGridLines" : false}
                },
                yaxis: {
                    tickOptions: {"scaleShowGridLines" : false}
                }
            };`

Managed bean :

private void createLineModels() {
    lineModel1 = initLinearModel();
    lineModel1.setExtender("chartExtender");

My Question is:

  1. If I add 'this.cfg.axes' in JavaScript, the graph will hidden. How can I disable only vertical OR horizontal grids?`
  2. Is it possible to change the line chart background multi-color OR alternate color background? How to achieve above mentioned?
0

There are 0 answers