Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. function createChart() {
  2. if (googleChartsLoaded) {
  3. pivot.googlecharts.getData({
  4. type: "pie",
  5. "slice": {
  6. "rows": [
  7. {
  8. "uniqueName": "Mission Outcome"
  9. }
  10. ],
  11. "columns": [
  12. {
  13. "uniqueName": "[Measures]"
  14. }
  15. ],
  16. "measures": [
  17. {
  18. "uniqueName": "Launch Date",
  19. "aggregation": "count"
  20. }
  21. ]
  22. }
  23. },
  24. drawChart,
  25. drawChart
  26. );
  27. }
  28. }
  29.  
  30. function drawChart(_data) {
  31. var data = google.visualization.arrayToDataTable(_data.data);
  32.  
  33. var options = {
  34. title: "Outcomes of SpaceX missions",
  35. legend: {
  36. position: 'top'
  37. },
  38. colors: ['#49a6df', '#f0b33f']
  39. };
  40.  
  41. var chart = new google.visualization.PieChart(document.getElementById('googlechart-container'));
  42. chart.draw(data, options);
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement