SHARE
TWEET

Untitled

a guest Jul 16th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top