1 <script language="javascript" src="http://www.google.com/jsapi"></script>2 3 <div id="chart"></div>4 5 <script type="text/javascript">6 var queryString = '';7 var dataUrl = '';8 9 function onLoadCallback() {10 if (dataUrl.length > 0) {11 var query = new google.visualization.Query(dataUrl);12 query.setQuery(queryString);13 query.send(handleQueryResponse);14 } else {15 var dataTable = new google.visualization.DataTable();16 dataTable.addRows(24);17 18 dataTable.addColumn('number');19 dataTable.addColumn('number');20 dataTable.setValue(0, 0, 72.35108923511953);21 dataTable.setValue(0, 1, 27.789056414951364);22 dataTable.setValue(1, 0, 81.11543163224722);23 dataTable.setValue(1, 1, 35.72085387005671);24 dataTable.setValue(2, 0, 83.47316488454418);25 dataTable.setValue(2, 1, 36.12084391369358);26 dataTable.setValue(3, 0, 87.93512353628822);27 dataTable.setValue(3, 1, 31.447248385531655);28 dataTable.setValue(4, 0, 95.14153876140793);29 dataTable.setValue(4, 1, 28.20694587154829);30 dataTable.setValue(5, 0, 97.99969858744709);31 dataTable.setValue(5, 1, 30.479856570300527);32 dataTable.setValue(6, 0, 99.8991142087459);33 dataTable.setValue(6, 1, 39.192718253632584);34 dataTable.setValue(7, 0, 93.38165071355742);35 dataTable.setValue(7, 1, 37.10659465753081);36 dataTable.setValue(8, 0, 89.78719118179541);37 dataTable.setValue(8, 1, 42.05702820676499);38 dataTable.setValue(9, 0, 87.1921151516775);39 dataTable.setValue(9, 1, 51.39362123534772);40 dataTable.setValue(10, 0, 88.00998548967064);41 dataTable.setValue(10, 1, 54.83688500977143);42 dataTable.setValue(11, 0, 80.84866432379678);43 dataTable.setValue(11, 1, 51.86763287674881);44 dataTable.setValue(12, 0, 76.00204823469271);45 dataTable.setValue(12, 1, 48.992050323052716);46 dataTable.setValue(13, 0, 74.00883409879336);47 dataTable.setValue(13, 1, 51.819042505303166);48 dataTable.setValue(14, 0, 68.98705238383563);49 dataTable.setValue(14, 1, 49.06206320989337);50 dataTable.setValue(15, 0, 59.563853783530384);51 dataTable.setValue(15, 1, 39.19117214202864);52 dataTable.setValue(16, 0, 55.08693247027724);53 dataTable.setValue(16, 1, 29.34471408081726);54 dataTable.setValue(17, 0, 43.95318652424536);55 dataTable.setValue(17, 1, 22.073745067020244);56 dataTable.setValue(18, 0, 46.98469219619243);57 dataTable.setValue(18, 1, 36.2650926453676);58 dataTable.setValue(19, 0, 48.43394788451287);59 dataTable.setValue(19, 1, 41.939063179128944);60 dataTable.setValue(20, 0, 50.49465341451327);61 dataTable.setValue(20, 1, 40.001006567338884);62 dataTable.setValue(21, 0, 48.09168797837085);63 dataTable.setValue(21, 1, 43.11748811993581);64 dataTable.setValue(22, 0, 38.80484847246397);65 dataTable.setValue(22, 1, 38.13212278297358);66 dataTable.setValue(23, 0, 35.45723382242671);67 dataTable.setValue(23, 1, 39.03601512176021);68 69 draw(dataTable);70 }71 }72 73 function draw(dataTable) {74 var vis = new google.visualization.ImageChart(document.getElementById('chart'));75 var options = {76 chxl: '',77 chxp: '',78 chxr: '0,0,125',79 chxs: '1,676767,11.7,0,l,676767',80 chxtc: '',81 chxt: 'y,x',82 chbh: 'a,4,0',83 chs: '560x150',84 cht: 'bvs',85 chco: 'CB6C5B,568CBB',86 chd: 's:sxz26895312xutqkibdefdYW,RWWTRTYXafhgegeYSNWaYaXY',87 chdl: '|',88 chg: '-1,0,0,4'89 };90 vis.draw(dataTable, options);91 }92 93 function handleQueryResponse(response) {94 if (response.isError()) {95 alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());96 return;97 }98 draw(response.getDataTable());99 }100 101 google.load("visualization", "1", {packages:["imagechart"]});102 google.setOnLoadCallback(onLoadCallback);103 104 </script>105
Enlace
El enlace para compartir es: