Hi all; I'm new to the Visualization API, and frankly a very novice coder too. I'm working to display two graphs on one visualisation as the data on three or four of my rows dwarfs everything else in the table/graph and I could not find the way to have two x axes.
However, my code does produces only a blank screen at present. I have another version that works as a single graph, so I wondered if anyone could spot where I've gone wrong? Secondly, I'm interested in implementing a rowfilter to allow users to filter this dataset. Specifically so that when the use selects the row label, such as UK NUC, they see all non-blank rows under that column. I understand that there is no rowfilter function - is there an alternative? Thanks Ian <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title> Google Visualization API Sample </title> <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('visualization', '1.1', {packages: ['controls']}); </script> <script type="text/javascript"> function drawChart() { // Prepare the data var data1 = google.visualization.arrayToDataTable([ ['Country', 'UK Catchall', 'US Catchall', 'US Nuc', 'UK Nuc', 'UK Missile', 'US Missile', 'UK Nuc/missile', 'US Nuc/missile', 'US CW', 'UK CW', 'USBW', 'UKBW'], ['Venezuela', 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0], ['UK', 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], ['Ukraine', 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0], ['UAE', -7, 1, 3, 0, 0, 3, 0, 0, 3, 0, 0, 1], ['Turkey', -2, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0], ['Taiwan', 0, 0, 3, 0, 0, 1, -1, 11, 2, 4, 1, 0], ['Sudan', 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ['South Africa',0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0], ['Singapore', -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ['Russia', -1, 7, 3, -1, 0, 3, 0, 8, 0, 0, 1, 0], ['South Korea', 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0], ['Nicaragua', 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ['Myanmar', 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], ['Malaysia', -2, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0], ['Lithuania', 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], ['Israel', 0, 2, 9, 0, 0, 1, -1, 3, 10, 12, 4, 0], ['Hong Kong', -1, 1, 1, 0, 0, 0, 0, 4, 3, 0, 0, 0], ['Germany', -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ['France', 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0], ['Finland', 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], ['DPRK', 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0], ['Cuba', 0, 15, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0], ['Cayman Islands',1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ['Brazil', 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0], ['Belarus', 0, 2, 5, 0, 0, 0, -1, 0, 0, 0, 0, 0], ['Iraq', 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0], ['Egypt', 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0], ['Singapore', 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0], ['Bangladesh', 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], ['Belgum', 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], ['Germnany', 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], ['Italy', 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], ['Ivory Coast', 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], ['Saudia Arabia',0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0], ['Vietnam', 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0], ['Azerbaijan', -1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], ['Armenia', 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ['Oman', 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ['Sweden', 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], ]); var data2 = google.visualization.arrayToDataTable([ ['Iran', -210, 2, 0, -13, 34, 3, 0, 0, 0, 25, 0, 0], ['India', -15, 43, 15, -9, 0, 8, 0, 10, 13, 2, 1, 0], ['China', -12, 15, 36, -13, 0, 11, -8, 45, 27, 0, 29, 0], ['Pakistan', -50, 75, 17, 0, 0, 0, 0, 3, 14, 6, 0, 0], ['Syria', -23, 21, 3, 0, 0, 4, 0, 0, 1, 0, 0, 0], ]); var options1 = {'width':1000, 'height':800}; 'isStacked': true} }); var options2 = {'width':1000, 'height':800}; 'isStacked': true} }); } var chart = new google.visualization.barChart(document.getElementById('chart_div')); chart.draw(data1, options); // var chart2 = new google.visualization.barChart(document.getElementById('chart_div2')); chart2.draw(data2, options2); google.setOnLoadCallback(drawVisualization); </script> </html> -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/7fUuavthyjUJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
