Dual Y-axis not being displayed, the right side y-axis was displaying previously but now there is problem with that..

36 views
Skip to first unread message

umar.ra...@gmail.com

unread,
Jun 30, 2016, 5:38:51 AM6/30/16
to Google Visualization API
Dear All,

i am facing problem with Dual Y-axis , the right side y-axis is not being displaying which was working fine few days back..
please guide me what will be wrong, i am attaching screen shot.
f0df63e06e06b581b04ec6271f54621e.png

Daniel LaLiberte

unread,
Jun 30, 2016, 9:16:14 AM6/30/16
to Google Visualization API
We can't tell much from only a screen shot, except that, indeed, there is no right side axis.  Can you post a link to your page so we can debug to see your code and options, or better, create an example on jsfiddle?  Thanks.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/85c0bb86-0306-4b63-a7f6-99d663acd8ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

umar.ra...@gmail.com

unread,
Jun 30, 2016, 9:20:55 AM6/30/16
to Google Visualization API
Below is whole code for chart the check for if(0) not displaying means else part not working. please guide whats wrong with it.


 
<html>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>

<script type="text/javascript">
      google.load("visualization", "1", {packages:['corechart', 'line']});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
        ['Volume', 'Static Pressure in (WG)', 'Fan power', {'type': 'string', 'role': 'style'}, {type:'string', role:'annotation'}, 'System Curve', {'type': 'string', 'role': 'style'}, {type:'string', role:'annotation'}],
[4783.99, 1197.93, null, null, null, null, null, null],
        [4281.76, 2181.03, null, null, null, null, null, null],
        [3771.01, 3005.52, null, null, null, null, null, null],
        [3285.80, 3617.43, null, null, null, null, null, null],
        [2638.86, 4283.32, null, null, null, null, null, null],
        [2217.49, 4732.13, null, null, null, null, null, null],
        [1759.94, 5078.57, null, null, null, null, null, null],
        [1015.11, 5416.02, null, null, null, null, null, null],
        [110.54,  5289.88, null, null, null, null, null, null],
        [0,       5274.29, null, null, null, null, null, null],
[4783.99, null, 17.49, null, null, null, null, null],
        [4281.76, null, 15.67, null, null, null, null, null], 
        [3771.01, null, 13.93, null, null, null, null, null],
        [3285.80, null, 12.29, null, null, null, null, null],
        [2638.86, null, 10.36, null, null, null, null, null],
        [2217.49, null, 9.24, null, null, null, null, null],        
[1759.94, null, 8.15, null, null, null, null, null],
        [1015.11, null, 6.02, null, null, null, null, null],
        [110.54,  null, 3.80, null, null, null, null, null],
        [0,       null, 3.53, null, null, null, null, null],
[0,       null, null , null, null, 0, null, null],
        [667.43,  null, null , null, null, 622.72, null, null], 
        [943.89,  null, null , null, null, 1245.44, null, null],
        [1156.03, null, null , null, null, 1868.16, null, null],
        [1334.86, null, null , null, null, 2490.88, null, null],
        [1492.42, null, null , null, null, 3113.61, null, null],
        [1634.87, null, null , null, null, 3736.33, null, null],
        [1765.86, null, null , null, null, 4359.05, null, null],       
        [2002.30,  null, null , null, null, 5604.50, null, null],
[1887.78,  null, null ,null, null, 4981.77, 'point { size: 8; shape-type: diamond; fill-color: black;  }',null],
[1888,  null, 8.46 ,'point { size: 8; shape-type: round; fill-color:grey; }', 'Power', null, null, null],
[2500,  null, null ,null, null, 4500.77, 'point { size: 0; shape-type: round; fill-color: grey;  }', 'Static Pressure'], 
        ]);
if(0){
        var options = {
title: 'Static Pressure and Power', 
curveType: 'function',
pointsVisible:'True',
   crosshair: { trigger: 'both' },   
            tooltip: { trigger: 'selection' },
curveType: 'function',
baselineColor: '#ccc',
            gridlineColor: '#ccc',
annotations: {
stemColor : 'none'
},
  'width':900,
  'height':500,
            hAxis: {title: 'Volume (CFM)',
viewWindowMode: 'explicit',
gridlines: {
               count: 10,
  
                     }
},
            vAxes: {0: {   
                       title: '\nStatic Pressure (WG)',
  viewWindowMode: 'explicit',
gridlines: {
count: 10,
                         }
 
                       },
                    1: { title: 'Fan Power',
viewWindowMode: 'explicit',
          gridlines: {
                               count: 10,
                       }
  
}, 
                   },
            series:{
0: { targetAxisIndex:0 },   
                    1: { targetAxisIndex:1 },
   2: { lineDashStyle: [4, 4]},
                  },
          colors: ["blue", "green", "red"],
        };
}
else
{
var options = {
//title: 'Static Pressure and Power', 
  //crosshair: { trigger: 'both' },   
           //tooltip: { trigger: 'selection' },
curveType: 'function',
   pointsVisible:'True',
baselineColor: '#ccc',
            gridlineColor: '#ccc',
annotations: {
stemColor : 'none'
},
//'width':900,
//'height':500,
            hAxis: {title: 'Volume (CFM)',
viewWindowMode: 'explicit',

                gridlines: {
               count: 10,
  
                     }
},
            vAxes: {0: {   
                       title: 'Static Pressure (WG1)',
  gridlines: {
  count: 10,
  
                     }
 
                       },
                    1: { title: 'Fan Powerusman',
  gridlines: {
color: 'transparent',
}
}, 
                   },
            series:{
0: { targetAxisIndex:0 },   
                    1: { targetAxisIndex:1,lineDashStyle: [4, 4] },
   //2: { lineDashStyle: [4, 4]},
                  },
          colors: ["blue", "red", "green"],
 //chartArea: { left: "15%", width: "80%", height: "80%", top: "10%", right: "0%"}
 chartArea: { left: "11%", width: "80%", height: "70%", top: "10%", right: "0%"}
        };
}
        var chart = new google.visualization.LineChart(document.getElementById('chart_id'));
        chart.draw(data, options);
      }
 //alert("usman");
 //alert(data[1][1]);
</script>
<div id="chart_id" style="width: 700px; height: 300px;"></div>
</html>

Daniel LaLiberte

unread,
Jun 30, 2016, 9:34:12 AM6/30/16
to Google Visualization API
You have set the chartArea.right to 0%, and that's what you are getting.  Change it to another number if you want more than 0%.  Perhaps it didn't work before, though I am not sure what change in the update I just posted about would have caused this.

Here is your example in a jsfiddle:  https://jsfiddle.net/dlaliberte/t0od9bf3/

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.

For more options, visit https://groups.google.com/d/optout.

Umar Rasheed

unread,
Jul 1, 2016, 1:21:14 AM7/1/16
to google-visua...@googlegroups.com
You save my life.it really work perfectly.... 😊

Thank You very very much!!!





You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/yk2BefaT_BE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
Reply all
Reply to author
Forward
0 new messages