Guest User

Untitled

a guest
Feb 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. google.charts.load('current', {
  4. 'packages': ['bar']
  5. });
  6. google.charts.setOnLoadCallback(drawChart);
  7.  
  8. function drawChart() {
  9.  
  10. var data=google.visualization.arrayToDataTable(<%=obtenerDatosComparativos()%>);
  11.  
  12. var options = {
  13. chart2: {
  14. title: 'Compraración Perfil',
  15. subtitle: 'Grafico comparativo perfil - Persona'
  16. },
  17. bars: 'vertical',
  18. vAxis: {
  19. format: 'decimal'
  20. },
  21. height: 400,
  22. colors: ['#3633FF', '#C4060F', ]
  23. };
  24.  
  25. var chart2 = new google.charts.Bar(document.getElementById('chart_div'));
  26.  
  27. google.visualization.events.addListener(chart2, 'ready', function() {
  28. chart_div = chart2.getImageURI();
  29. console.log(chart_div);
  30. document.getElementById('hdImgSrcChart').value = chart_div;
  31. });
  32.  
  33. chart2.draw(data, google.charts.Bar.convertOptions(options));
  34.  
  35. }
  36. </script>
Add Comment
Please, Sign In to add comment