0

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?
Kukeltje
  • 12,223
  • 4
  • 24
  • 47
user3114967
  • 639
  • 5
  • 15
  • 38
  • 1
    The attribute `extender` is unavailable in PrimeFaces 5.2. – Tiny Jun 05 '15 at 09:52
  • Tiny is right, as was already posted in your other question: http://stackoverflow.com/questions/30644676/how-to-use-line-chart-extender-attribute-in-primefaces-5-2 which you accepted. I see you also correctly add it in your model, so remove it from the `p:chart` tag – Kukeltje Jun 05 '15 at 10:26
  • and it is good practice to only have one question per question (get it ;-)) – Kukeltje Jun 05 '15 at 10:31

0 Answers0