Thursday, November 24, 2016

How to easily get a pie chart in blogger

Okay, who would've known that getting a pie chart into blogger (or any website or blog) was so easy...



Yup, just put the following code into the HTML section of blogger and you are good to go. Of course, you can modify the ethnicities and percentages to match you.

<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js"></script>
   <br />
<div id="myDiv" style="height: 380px; width: 480px;">
<!-- Plotly chart will be drawn inside this DIV --></div>
<script type="text/javascript">
    var data = [{
    values: [63, 13, 7, 4, 2, 6, 4, 1],
    labels: ['Italy/Greece', 'Europe West', 'Great Britian', 'Ireland', 'Iberian Peninsula', 'Caucasus', 'Middle East', 'Africa North'],
           type: 'pie'
    }];
   var layout = {
   height: 400,
   width: 500
  };
  Plotly.newPlot('myDiv', data, layout);
</script>



No comments:

Post a Comment

The source code for gliesians.com is for sale on Ebay.

I've decided to shut down gliesians.com and sell the source code. If anyone is looking to purchase the related source, you can find it...