Skip to content

Instantly share code, notes, and snippets.

@infographicstw
Last active August 29, 2015 14:19
Show Gist options
  • Save infographicstw/17c3926bc2968bfd1358 to your computer and use it in GitHub Desktop.
Save infographicstw/17c3926bc2968bfd1358 to your computer and use it in GitHub Desktop.
Software Piracy Value

Demonstration for Software Piracy Value Article

LICENSE

MIT License

<!DOCTYPE html><html lang="en"><head prefix="og: http://ogp.me/ns#"><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>template</title><!-- libraries--><link rel="icon" type="image/x-icon" href="thumbnail.png"><script type="text/javascript" src="//codeorigin.jquery.com/jquery-1.10.2.min.js"></script><script type="text/javascript" src="//d3js.org/d3.v3.min.js"></script><!-- custom files--><link rel="stylesheet" type="text/css" href="index.css"><script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script><script type="text/javascript" src="bar.js"></script></head><body><div id="bar"></div></body></html>
$(document).ready(function(){return d3.csv("piracy.csv",function(e){var t,a,n,r,i,l,o,s;for(e=e.map(function(e){return{name:e.Country,data:parseInt(e["2013 Value"]),rate:parseInt(e["2013 Rate"])}}),e.sort(function(e,t){return t.data-e.data}),e=e.splice(0,20),t={},a=0,n=e.length;n>a;++a)r=e[a],t[r.name]=r.rate;for(l=[],a=0,n=e.length;n>a;++a)o=e[a],l.push(o.name);return i=l,s=e.map(function(e){return e.data}),console.log(s),new Highcharts.Chart({chart:{renderTo:$("#bar")[0],type:"bar",marginLeft:130},plotOptions:{bar:{dataLabels:{enabled:!0,formatter:function(){return t[this.key]+"%"}}}},title:{text:"Value of Pirated Software in Millions USD",align:"center",x:0},xAxis:{categories:i,labels:{enabled:!0}},credits:{enabled:!1},yAxis:{allowDecimals:!0,title:{text:"Value of Pirated Software in Millions USD"},min:0,max:12e3},legend:{enabled:!1},series:[{data:s}]})})});
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
#pie {
width: 100%;
height: 700px;
margin: 0 auto;
}
#bar {
width: 100%;
margin: 0 auto;
height: 600px;
}
<!DOCTYPE html><html lang="en"><head prefix="og: http://ogp.me/ns#"><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>template</title><!-- libraries--><link rel="icon" type="image/x-icon" href="thumbnail.png"><script type="text/javascript" src="//codeorigin.jquery.com/jquery-1.10.2.min.js"></script><script type="text/javascript" src="//d3js.org/d3.v3.min.js"></script><!-- custom files--><link rel="stylesheet" type="text/css" href="index.css"><script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script><script type="text/javascript" src="index.js"></script></head><body><div id="pie"></div></body></html>
$(document).ready(function(){return d3.csv("piracy.csv",function(t){var e,n,r,a,i,o,l,s,c,u,h,p,f,m,y,d;for(e=Highcharts.getOptions().colors,n={},r=0,a=t.length;a>r;++r)i=t[r],(n[o=i.Continent]||(n[o]=[])).push(i);l=0;for(s in n){for(c=0,r=0,a=(u=n[s]).length;a>r;++r)i=u[r],c+=parseInt(i["2013 Value"]);n[s].y=c,n[s].name=s,n[s].color=e[l],l++}p=[];for(f in n)m=n[f],p.push((u={},u.color=m.color,u.name=m.name,u.y=m.y,u));h=p,console.log(h),y=[],l=0;for(s in n){for(r=0,a=(u=n[s]).length;a>r;++r)d=u[r],y.push({color:e[l],y:parseInt(d["2013 Value"]),name:d.Country});l++}return $("#pie").highcharts({chart:{type:"pie",marginTop:0},title:{text:"Annual Software Piracy"},subtitle:{text:"Commercial Value in Millions USD"},credits:{enabled:!1},yAxis:{title:{text:"Total percent market share"}},plotOptions:{pie:{shadow:!1,center:["50%","50%"]}},tooltip:{valueSuffix:" USD"},series:[{name:"Total Pirated",data:h,size:"30%",dataLabels:{formatter:function(){return this.y>3?this.point.name:null},color:"white",distance:-5}},{name:"Pirated by Country",data:y,size:"70%",innerSize:"60%",dataLabels:{formatter:function(){return this.y>1?"<b>"+this.point.name+"</b> / $"+this.y:null}}}]})})});
The MIT License (MIT)
Copyright (c) 2015, Kirby T. Wu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Continent Country 2013 Rate 2011 Rate 2009 Rate 2007 Rate 2013 Value 2011 Value 2009 Value 2007 Value
Asia Pacific Australia 21 23 25 28 743 763 550 492
Asia Pacific Bangladesh 87 90 91 92 197 147 127 92
Asia Pacific Brunei 66 67 67 67 13 25 14 13
Asia Pacific China 74 77 79 82 8767 8902 7583 6664
Asia Pacific Hong Kong 43 43 47 51 316 232 218 224
Asia Pacific India 60 63 65 69 2911 2930 2003 2025
Asia Pacific Indonesia 84 86 86 84 1463 1467 886 411
Asia Pacific Japan 19 21 21 23 1349 1875 1838 1791
Asia Pacific Malaysia 54 55 58 59 616 657 453 311
Asia Pacific New Zealand 20 22 22 22 78 99 63 55
Asia Pacific Pakistan 85 86 84 84 344 278 166 125
Asia Pacific Philippines 69 70 69 69 444 338 217 147
Asia Pacific Singapore 32 33 35 37 344 255 197 159
Asia Pacific South Korea 38 40 41 43 712 815 575 549
Asia Pacific Sri Lanka 83 84 89 90 187 86 77 93
Asia Pacific Taiwan 38 37 38 40 305 293 227 215
Asia Pacific Thailand 71 72 75 78 869 852 694 468
Asia Pacific Vietnam 81 81 85 85 620 395 353 200
Central and Eastern Europe Albania 75 75 75 78 10 6 8 11
Central and Eastern Europe Armenia 86 88 90 93 26 26 14 8
Central and Eastern Europe Azerbaijan 85 87 88 92 103 67 52 50
Central and Eastern Europe Belarus 86 87 87 0 173 87 55 0
Central and Eastern Europe Bosnia 65 66 66 68 21 15 14 13
Central and Eastern Europe Bulgaria 63 64 67 68 101 102 115 63
Central and Eastern Europe Croatia 52 53 54 54 64 74 71 68
Central and Eastern Europe Czech Republic 34 35 37 39 182 214 174 161
Central and Eastern Europe Estonia 47 48 50 51 20 25 19 20
Central and Eastern Europe FYROM 65 66 67 68 19 22 15 11
Central and Eastern Europe Georgia 90 91 95 0 40 52 54 0
Central and Eastern Europe Hungary 39 41 41 42 127 143 113 125
Central and Eastern Europe Kazakhstan 74 76 78 79 136 123 74 110
Central and Eastern Europe Latvia 53 54 56 56 29 32 24 29
Central and Eastern Europe Lithuania 53 54 54 56 47 44 31 37
Central and Eastern Europe Moldova 90 90 91 92 57 45 28 43
Central and Eastern Europe Montenegro 78 79 81 83 7 7 11 7
Central and Eastern Europe Poland 51 53 54 57 563 618 506 580
Central and Eastern Europe Romania 62 63 65 68 208 207 183 151
Central and Eastern Europe Russia 62 63 67 73 2658 3227 2613 4123
Central and Eastern Europe Serbia 69 72 74 76 70 104 67 72
Central and Eastern Europe Slovakia 37 40 43 45 67 68 65 54
Central and Eastern Europe Slovenia 45 46 46 48 41 51 39 39
Central and Eastern Europe Ukraine 83 84 85 83 444 647 272 403
Latin America Argentina 69 69 71 74 950 657 645 370
Latin America Bolivia 79 79 80 82 95 59 40 19
Latin America Brazil 50 53 56 59 2851 2848 2254 1617
Latin America Chile 59 61 64 66 378 382 315 187
Latin America Colombia 52 53 55 58 396 295 244 127
Latin America Costa Rica 59 58 59 61 98 62 33 22
Latin America Dominican Republic 75 76 77 79 73 93 66 39
Latin America Ecuador 68 68 67 66 130 92 65 33
Latin America El Salvador 80 80 80 81 72 58 46 28
Latin America Guatemala 79 79 80 80 167 116 74 41
Latin America Honduras 74 73 74 74 38 24 17 8
Latin America Mexico 54 57 60 61 1211 1249 1056 836
Latin America Nicaragua 82 79 79 80 23 9 5 4
Latin America Panama 72 72 73 74 120 74 42 22
Latin America Paraguay 84 83 82 82 115 73 29 13
Latin America Peru 65 67 70 71 249 209 124 75
Latin America Uruguay 68 68 68 69 74 85 40 23
Latin America Venezuela 88 88 87 87 1030 668 685 464
Middle East and Africa Algeria 85 84 84 84 102 83 55 86
Middle East and Africa Bahrain 53 54 54 57 27 23 21 27
Middle East and Africa Botswana 79 80 79 82 20 16 11 14
Middle East and Africa Cameroon 82 83 83 84 9 9 7 5
Middle East and Africa Egypt 62 61 59 60 198 172 146 131
Middle East and Africa Iraq 86 86 85 85 116 172 129 124
Middle East and Africa Israel 30 31 33 32 177 192 148 121
Middle East and Africa Ivory Coast 80 81 79 81 24 16 14 15
Middle East and Africa Jordan 57 58 57 60 35 31 26 20
Middle East and Africa Kenya 78 78 79 81 128 85 66 28
Middle East and Africa Kuwait 58 59 60 62 97 72 62 61
Middle East and Africa Lebanon 71 71 72 73 65 52 46 44
Middle East and Africa Libya 89 90 88 88 50 60 25 22
Middle East and Africa Mauritius 55 57 56 57 7 7 4 4
Middle East and Africa Morocco 66 66 66 67 69 91 64 66
Middle East and Africa Nigeria 81 82 83 82 287 251 156 114
Middle East and Africa Oman 60 61 63 61 65 36 39 23
Middle East and Africa Qatar 49 50 51 54 77 62 50 25
Middle East and Africa Reunion 39 40 40 40 1 1 1 1
Middle East and Africa Saudi Arabia 50 51 51 51 421 449 304 170
Middle East and Africa Senegal 77 78 78 80 9 9 5 6
Middle East and Africa South Africa 34 35 35 34 385 564 324 284
Middle East and Africa Tunisia 75 74 72 76 66 51 44 54
Middle East and Africa Turkey 60 62 63 65 504 526 415 365
Middle East and Africa UAE 36 37 36 35 230 208 155 94
Middle East and Africa Yemen 87 89 90 89 9 15 10 13
Middle East and Africa Zambia 81 82 82 82 3 3 2 2
Middle East and Africa Zimbabwe 91 92 92 91 4 4 4 3
North America Canada 25 27 29 33 1089 1141 943 1071
North America Puerto Rico 42 42 46 44 27 44 46 33
North America United States 18 19 20 20 9737 9773 8390 8040
Western Europe Austria 22 23 25 25 173 226 212 157
Western Europe Belgium 24 24 25 25 237 252 239 223
Western Europe Cyprus 47 48 48 50 19 19 16 14
Western Europe Denmark 23 24 26 25 224 222 203 193
Western Europe Finland 24 25 25 25 208 210 175 160
Western Europe France 36 37 40 42 2685 2754 2544 2601
Western Europe Germany 24 26 28 27 2158 2265 2023 1937
Western Europe Greece 62 61 58 58 220 343 248 198
Western Europe Iceland 48 48 49 48 12 17 11 33
Western Europe Ireland 33 34 35 34 107 144 125 106
Western Europe Italy 47 48 49 49 1747 1945 1733 1779
Western Europe Luxembourg 20 20 21 21 30 33 30 16
Western Europe Malta 44 43 45 46 5 7 7 7
Western Europe Netherlands 25 27 28 28 584 644 525 502
Western Europe Norway 25 27 29 29 248 289 195 195
Western Europe Portugal 40 40 40 43 180 245 221 167
Western Europe Spain 45 44 42 43 1044 1216 1014 903
Western Europe Sweden 23 24 25 25 397 461 304 324
Western Europe Switzerland 24 25 25 25 469 514 344 303
Western Europe United Kingdom 24 26 27 26 2019 1943 1581 1837
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment