Simple example of a Stacked Bar Chart in D3.js with legend, text labels, tooltips and word wrapping for X axis. Legend based on Susie Lu's library D3 Legend http://d3-legend.susielu.com/
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iso lat long name | |
AD 42.546245 1.601554 Andorra | |
AE 23.424076 53.847818 United Arab Emirates | |
AF 33.93911 67.709953 Afghanistan | |
AG 17.060816 -61.796428 Antigua and Barbuda | |
AI 18.220554 -63.068615 Anguilla | |
AL 41.153332 20.168331 Albania | |
AM 40.069099 45.038189 Armenia | |
AN 12.226079 -69.060087 Netherlands Antilles | |
AO -11.202692 17.873887 Angola |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Normalizes a value given scale : [minRange, maxRange], | |
* valueRange: [minValue, maxValue] and the number: value | |
* | |
* Adapted from http://mathforum.org/library/drmath/view/60433.html | |
* @param value | |
* @param minRange | |
* @param maxRange | |
* @param minValue | |
* @param maxValue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var BubbleMap = (function(){ | |
function BubbleMap(data, elem, width, height, minRadius, maxRadius){ | |
this.width = width; | |
this.height = height; | |
this.elem = elem[0]; | |
this.data = data; | |
this.minRadius = minRadius; | |
this.maxRadius = maxRadius; | |
this.init(); | |
this.drawCountries(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="application/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.js"></script> | |
<!--<script type="application/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.1/d3.js"></script>--> | |
<style> | |
svg { | |
width: 100%; | |
height: 100%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<!--<script type="application/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.js"></script>--> | |
<script type="application/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.1/d3.js"></script> | |
<style> | |
svg { | |
width: 100%; | |
height: 100%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<!--<script type="application/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.js"></script>--> | |
<script type="application/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.1/d3.js"></script> | |
</head> | |
<body> | |
<!-- Visualization Placeholder --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<!--<script type="application/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.js"></script>--> | |
<script type="application/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.1/d3.js"></script> | |
</head> | |
<body> | |
<!-- Visualization Placeholder --> | |
<div id="bar-chart"></div> |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iso lat long name | |
US 37.09024 -95.712891 United States | |
ZA -30.559482 22.937506 South Africa |
OlderNewer