xxxxxxxxxx
<meta charset = 'utf-8'>
<html>
<head>
<link rel='stylesheet' href='https://nvd3.org/src/nv.d3.css'>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js' type='text/javascript'></script>
<script src='https://d3js.org/d3.v3.min.js' type='text/javascript'></script>
<script src='https://timelyportfolio.github.io/rcharts_nvd3_tests/libraries/widgets/nvd3/js/nv.d3.min-new.js' type='text/javascript'></script>
<script src='https://nvd3.org/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='chart9c520f049ae' class='rChart nvd3'></div>
<script type='text/javascript'>
$(document).ready(function(){
drawchart9c520f049ae()
});
function drawchart9c520f049ae(){
var opts = {
"dom": "chart9c520f049ae",
"width": 800,
"height": 400,
"x": "Variable",
"y": "Percentage",
"group": "Grade",
"type": "multiBarChart",
"id": "chart9c520f049ae"
},
data = [
{
"Variable": "Use of Inputs",
"Grade": "A",
"Percentage": 0.57
},
{
"Variable": "Use of Inputs",
"Grade": "B",
"Percentage": 0.22
},
{
"Variable": "Use of Inputs",
"Grade": "C",
"Percentage": 0.17
},
{
"Variable": "Use of Inputs",
"Grade": "D",
"Percentage": 0.04
},
{
"Variable": "Planting",
"Grade": "A",
"Percentage": 0.08
},
{
"Variable": "Planting",
"Grade": "B",
"Percentage": 0.04
},
{
"Variable": "Planting",
"Grade": "C",
"Percentage": 0.69
},
{
"Variable": "Planting",
"Grade": "D",
"Percentage": 0.18
},
{
"Variable": "Pest Management (Sowing)",
"Grade": "A",
"Percentage": 0.13
},
{
"Variable": "Pest Management (Sowing)",
"Grade": "B",
"Percentage": 0.53
},
{
"Variable": "Pest Management (Sowing)",
"Grade": "C",
"Percentage": 0.29
},
{
"Variable": "Pest Management (Sowing)",
"Grade": "D",
"Percentage": 0.04
},
{
"Variable": "Pest Management (Vegetative)",
"Grade": "A",
"Percentage": 0.05
},
{
"Variable": "Pest Management (Vegetative)",
"Grade": "B",
"Percentage": 0.02
},
{
"Variable": "Pest Management (Vegetative)",
"Grade": "C",
"Percentage": 0.06
},
{
"Variable": "Pest Management (Vegetative)",
"Grade": "D",
"Percentage": 0.87
}
]
if(!(opts.type==="pieChart" || opts.type==="sparklinePlus")) {
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]()
.x(function(d) { return d[opts.x] })
.y(function(d) { return d[opts.y] })
.width(opts.width)
.height(opts.height)
chart
.color([ "#1a9641", "#a6d96a", "#fdae61", "#d7191c" ])
chart.xAxis
.axisLabel("Grade Categories of All Groups in the Project in the Sowing Domains")
d3.select("#" + opts.id)
.append('svg')
.datum(data)
.transition().duration(500)
.call(chart);
nv.utils.windowResize(chart.update);
return chart;
});
};
</script>
</body>
</html>
Modified http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js to a secure url
Modified http://d3js.org/d3.v3.min.js to a secure url
Modified http://timelyportfolio.github.io/rCharts_nvd3_tests/libraries/widgets/nvd3/js/nv.d3.min-new.js to a secure url
Modified http://nvd3.org/lib/fisheye.js to a secure url
https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
https://d3js.org/d3.v3.min.js
https://timelyportfolio.github.io/rCharts_nvd3_tests/libraries/widgets/nvd3/js/nv.d3.min-new.js
https://nvd3.org/lib/fisheye.js