xxxxxxxxxx
<meta charset = 'utf-8'>
<html>
<head>
<link rel='stylesheet' href='//cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.css'>
<script src='//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'></script>
<script src='//d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='//cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js' type='text/javascript'></script>
<script src='//nvd3.org/assets/lib/fisheye.js' type='text/javascript'></script>
<style>
.rChart {
display: block;
margin-left: auto;
margin-right: auto;
width: 800px;
height: 400px;
}
</style>
</head>
<body >
<div id = 'chart1df2102f934' class = 'rChart nvd3'></div>
<script type='text/javascript'>
$(document).ready(function(){
drawchart1df2102f934()
});
function drawchart1df2102f934(){
var opts = {
"dom": "chart1df2102f934",
"width": 800,
"height": 400,
"x": "state",
"y": "n",
"type": "bar",
"id": "chart1df2102f934"
},
data = [
{
"state": "TX",
"n": 29
},
{
"state": "FL",
"n": 26
},
{
"state": "IL",
"n": 25
},
{
"state": "NY",
"n": 24
},
{
"state": "CA",
"n": 23
},
{
"state": "GA",
"n": 22
},
{
"state": "LA",
"n": 17
},
{
"state": "AL",
"n": 15
},
{
"state": "MD",
"n": 14
},
{
"state": "OH",
"n": 14
},
{
"state": "PA",
"n": 14
},
{
"state": "TN",
"n": 13
},
{
"state": "MI",
"n": 10
},
{
"state": "NC",
"n": 10
},
{
"state": "OK",
"n": 7
},
{
"state": "AR",
"n": 5
},
{
"state": "DC",
"n": 5
},
{
"state": "SC",
"n": 5
},
{
"state": "MN",
"n": 4
},
{
"state": "MO",
"n": 4
},
{
"state": "MS",
"n": 4
},
{
"state": "WA",
"n": 4
},
{
"state": "KS",
"n": 3
},
{
"state": "MA",
"n": 3
},
{
"state": "DE",
"n": 2
},
{
"state": "IA",
"n": 2
},
{
"state": "WI",
"n": 2
},
{
"state": "AZ",
"n": 1
},
{
"state": "IN",
"n": 1
},
{
"state": "KY",
"n": 1
},
{
"state": "NE",
"n": 1
},
{
"state": "NJ",
"n": 1
},
{
"state": "NV",
"n": 1
},
{
"state": null,
"n": 1
}
]
if(!(opts.type==="pieChart" || opts.type==="sparklinePlus" || opts.type==="bulletChart")) {
var data = d3.nest()
.key(function(d){
//return opts.group === undefined ? 'main' : d[opts.group]
//instead of main would think a better default is opts.x
return opts.group === undefined ? opts.y : d[opts.group];
})
.entries(data);
}
if (opts.disabled != undefined){
data.map(function(d, i){
d.disabled = opts.disabled[i]
})
}
nv.addGraph(function() {
var chart = nv.models[opts.type]()
.width(opts.width)
.height(opts.height)
if (opts.type != "bulletChart"){
chart
.x(function(d) { return d[opts.x] })
.y(function(d) { return d[opts.y] })
}
d3.select("#" + opts.id)
.append('svg')
.datum(data)
.transition().duration(500)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
};
</script>
<script></script>
</body>
</html>
https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
https://d3js.org/d3.v3.min.js
https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js
https://nvd3.org/assets/lib/fisheye.js