Skip to content

Instantly share code, notes, and snippets.

@patilv
Created October 27, 2015 12:19
Show Gist options
  • Save patilv/49826aa9870e46ad4c31 to your computer and use it in GitHub Desktop.
Save patilv/49826aa9870e46ad4c31 to your computer and use it in GitHub Desktop.
<!doctype HTML>
<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 = 'chart1038191c70bc' class = 'rChart nvd3'></div>
<script type='text/javascript'>
$(document).ready(function(){
drawchart1038191c70bc()
});
function drawchart1038191c70bc(){
var opts = {
"dom": "chart1038191c70bc",
"width": 800,
"height": 400,
"x": "Sepal.Width",
"y": "Sepal.Length",
"group": "Species",
"type": "scatterChart",
"id": "chart1038191c70bc"
},
data = [
{
"Sepal.Length": 5.1,
"Sepal.Width": 3.5,
"Petal.Length": 1.4,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 4.9,
"Sepal.Width": 3,
"Petal.Length": 1.4,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 4.7,
"Sepal.Width": 3.2,
"Petal.Length": 1.3,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 4.6,
"Sepal.Width": 3.1,
"Petal.Length": 1.5,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5,
"Sepal.Width": 3.6,
"Petal.Length": 1.4,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5.4,
"Sepal.Width": 3.9,
"Petal.Length": 1.7,
"Petal.Width": 0.4,
"Species": "setosa"
},
{
"Sepal.Length": 4.6,
"Sepal.Width": 3.4,
"Petal.Length": 1.4,
"Petal.Width": 0.3,
"Species": "setosa"
},
{
"Sepal.Length": 5,
"Sepal.Width": 3.4,
"Petal.Length": 1.5,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 4.4,
"Sepal.Width": 2.9,
"Petal.Length": 1.4,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 4.9,
"Sepal.Width": 3.1,
"Petal.Length": 1.5,
"Petal.Width": 0.1,
"Species": "setosa"
},
{
"Sepal.Length": 5.4,
"Sepal.Width": 3.7,
"Petal.Length": 1.5,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 4.8,
"Sepal.Width": 3.4,
"Petal.Length": 1.6,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 4.8,
"Sepal.Width": 3,
"Petal.Length": 1.4,
"Petal.Width": 0.1,
"Species": "setosa"
},
{
"Sepal.Length": 4.3,
"Sepal.Width": 3,
"Petal.Length": 1.1,
"Petal.Width": 0.1,
"Species": "setosa"
},
{
"Sepal.Length": 5.8,
"Sepal.Width": 4,
"Petal.Length": 1.2,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5.7,
"Sepal.Width": 4.4,
"Petal.Length": 1.5,
"Petal.Width": 0.4,
"Species": "setosa"
},
{
"Sepal.Length": 5.4,
"Sepal.Width": 3.9,
"Petal.Length": 1.3,
"Petal.Width": 0.4,
"Species": "setosa"
},
{
"Sepal.Length": 5.1,
"Sepal.Width": 3.5,
"Petal.Length": 1.4,
"Petal.Width": 0.3,
"Species": "setosa"
},
{
"Sepal.Length": 5.7,
"Sepal.Width": 3.8,
"Petal.Length": 1.7,
"Petal.Width": 0.3,
"Species": "setosa"
},
{
"Sepal.Length": 5.1,
"Sepal.Width": 3.8,
"Petal.Length": 1.5,
"Petal.Width": 0.3,
"Species": "setosa"
},
{
"Sepal.Length": 5.4,
"Sepal.Width": 3.4,
"Petal.Length": 1.7,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5.1,
"Sepal.Width": 3.7,
"Petal.Length": 1.5,
"Petal.Width": 0.4,
"Species": "setosa"
},
{
"Sepal.Length": 4.6,
"Sepal.Width": 3.6,
"Petal.Length": 1,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5.1,
"Sepal.Width": 3.3,
"Petal.Length": 1.7,
"Petal.Width": 0.5,
"Species": "setosa"
},
{
"Sepal.Length": 4.8,
"Sepal.Width": 3.4,
"Petal.Length": 1.9,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5,
"Sepal.Width": 3,
"Petal.Length": 1.6,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5,
"Sepal.Width": 3.4,
"Petal.Length": 1.6,
"Petal.Width": 0.4,
"Species": "setosa"
},
{
"Sepal.Length": 5.2,
"Sepal.Width": 3.5,
"Petal.Length": 1.5,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5.2,
"Sepal.Width": 3.4,
"Petal.Length": 1.4,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 4.7,
"Sepal.Width": 3.2,
"Petal.Length": 1.6,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 4.8,
"Sepal.Width": 3.1,
"Petal.Length": 1.6,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5.4,
"Sepal.Width": 3.4,
"Petal.Length": 1.5,
"Petal.Width": 0.4,
"Species": "setosa"
},
{
"Sepal.Length": 5.2,
"Sepal.Width": 4.1,
"Petal.Length": 1.5,
"Petal.Width": 0.1,
"Species": "setosa"
},
{
"Sepal.Length": 5.5,
"Sepal.Width": 4.2,
"Petal.Length": 1.4,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 4.9,
"Sepal.Width": 3.1,
"Petal.Length": 1.5,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5,
"Sepal.Width": 3.2,
"Petal.Length": 1.2,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5.5,
"Sepal.Width": 3.5,
"Petal.Length": 1.3,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 4.9,
"Sepal.Width": 3.6,
"Petal.Length": 1.4,
"Petal.Width": 0.1,
"Species": "setosa"
},
{
"Sepal.Length": 4.4,
"Sepal.Width": 3,
"Petal.Length": 1.3,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5.1,
"Sepal.Width": 3.4,
"Petal.Length": 1.5,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5,
"Sepal.Width": 3.5,
"Petal.Length": 1.3,
"Petal.Width": 0.3,
"Species": "setosa"
},
{
"Sepal.Length": 4.5,
"Sepal.Width": 2.3,
"Petal.Length": 1.3,
"Petal.Width": 0.3,
"Species": "setosa"
},
{
"Sepal.Length": 4.4,
"Sepal.Width": 3.2,
"Petal.Length": 1.3,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5,
"Sepal.Width": 3.5,
"Petal.Length": 1.6,
"Petal.Width": 0.6,
"Species": "setosa"
},
{
"Sepal.Length": 5.1,
"Sepal.Width": 3.8,
"Petal.Length": 1.9,
"Petal.Width": 0.4,
"Species": "setosa"
},
{
"Sepal.Length": 4.8,
"Sepal.Width": 3,
"Petal.Length": 1.4,
"Petal.Width": 0.3,
"Species": "setosa"
},
{
"Sepal.Length": 5.1,
"Sepal.Width": 3.8,
"Petal.Length": 1.6,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 4.6,
"Sepal.Width": 3.2,
"Petal.Length": 1.4,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5.3,
"Sepal.Width": 3.7,
"Petal.Length": 1.5,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 5,
"Sepal.Width": 3.3,
"Petal.Length": 1.4,
"Petal.Width": 0.2,
"Species": "setosa"
},
{
"Sepal.Length": 7,
"Sepal.Width": 3.2,
"Petal.Length": 4.7,
"Petal.Width": 1.4,
"Species": "versicolor"
},
{
"Sepal.Length": 6.4,
"Sepal.Width": 3.2,
"Petal.Length": 4.5,
"Petal.Width": 1.5,
"Species": "versicolor"
},
{
"Sepal.Length": 6.9,
"Sepal.Width": 3.1,
"Petal.Length": 4.9,
"Petal.Width": 1.5,
"Species": "versicolor"
},
{
"Sepal.Length": 5.5,
"Sepal.Width": 2.3,
"Petal.Length": 4,
"Petal.Width": 1.3,
"Species": "versicolor"
},
{
"Sepal.Length": 6.5,
"Sepal.Width": 2.8,
"Petal.Length": 4.6,
"Petal.Width": 1.5,
"Species": "versicolor"
},
{
"Sepal.Length": 5.7,
"Sepal.Width": 2.8,
"Petal.Length": 4.5,
"Petal.Width": 1.3,
"Species": "versicolor"
},
{
"Sepal.Length": 6.3,
"Sepal.Width": 3.3,
"Petal.Length": 4.7,
"Petal.Width": 1.6,
"Species": "versicolor"
},
{
"Sepal.Length": 4.9,
"Sepal.Width": 2.4,
"Petal.Length": 3.3,
"Petal.Width": 1,
"Species": "versicolor"
},
{
"Sepal.Length": 6.6,
"Sepal.Width": 2.9,
"Petal.Length": 4.6,
"Petal.Width": 1.3,
"Species": "versicolor"
},
{
"Sepal.Length": 5.2,
"Sepal.Width": 2.7,
"Petal.Length": 3.9,
"Petal.Width": 1.4,
"Species": "versicolor"
},
{
"Sepal.Length": 5,
"Sepal.Width": 2,
"Petal.Length": 3.5,
"Petal.Width": 1,
"Species": "versicolor"
},
{
"Sepal.Length": 5.9,
"Sepal.Width": 3,
"Petal.Length": 4.2,
"Petal.Width": 1.5,
"Species": "versicolor"
},
{
"Sepal.Length": 6,
"Sepal.Width": 2.2,
"Petal.Length": 4,
"Petal.Width": 1,
"Species": "versicolor"
},
{
"Sepal.Length": 6.1,
"Sepal.Width": 2.9,
"Petal.Length": 4.7,
"Petal.Width": 1.4,
"Species": "versicolor"
},
{
"Sepal.Length": 5.6,
"Sepal.Width": 2.9,
"Petal.Length": 3.6,
"Petal.Width": 1.3,
"Species": "versicolor"
},
{
"Sepal.Length": 6.7,
"Sepal.Width": 3.1,
"Petal.Length": 4.4,
"Petal.Width": 1.4,
"Species": "versicolor"
},
{
"Sepal.Length": 5.6,
"Sepal.Width": 3,
"Petal.Length": 4.5,
"Petal.Width": 1.5,
"Species": "versicolor"
},
{
"Sepal.Length": 5.8,
"Sepal.Width": 2.7,
"Petal.Length": 4.1,
"Petal.Width": 1,
"Species": "versicolor"
},
{
"Sepal.Length": 6.2,
"Sepal.Width": 2.2,
"Petal.Length": 4.5,
"Petal.Width": 1.5,
"Species": "versicolor"
},
{
"Sepal.Length": 5.6,
"Sepal.Width": 2.5,
"Petal.Length": 3.9,
"Petal.Width": 1.1,
"Species": "versicolor"
},
{
"Sepal.Length": 5.9,
"Sepal.Width": 3.2,
"Petal.Length": 4.8,
"Petal.Width": 1.8,
"Species": "versicolor"
},
{
"Sepal.Length": 6.1,
"Sepal.Width": 2.8,
"Petal.Length": 4,
"Petal.Width": 1.3,
"Species": "versicolor"
},
{
"Sepal.Length": 6.3,
"Sepal.Width": 2.5,
"Petal.Length": 4.9,
"Petal.Width": 1.5,
"Species": "versicolor"
},
{
"Sepal.Length": 6.1,
"Sepal.Width": 2.8,
"Petal.Length": 4.7,
"Petal.Width": 1.2,
"Species": "versicolor"
},
{
"Sepal.Length": 6.4,
"Sepal.Width": 2.9,
"Petal.Length": 4.3,
"Petal.Width": 1.3,
"Species": "versicolor"
},
{
"Sepal.Length": 6.6,
"Sepal.Width": 3,
"Petal.Length": 4.4,
"Petal.Width": 1.4,
"Species": "versicolor"
},
{
"Sepal.Length": 6.8,
"Sepal.Width": 2.8,
"Petal.Length": 4.8,
"Petal.Width": 1.4,
"Species": "versicolor"
},
{
"Sepal.Length": 6.7,
"Sepal.Width": 3,
"Petal.Length": 5,
"Petal.Width": 1.7,
"Species": "versicolor"
},
{
"Sepal.Length": 6,
"Sepal.Width": 2.9,
"Petal.Length": 4.5,
"Petal.Width": 1.5,
"Species": "versicolor"
},
{
"Sepal.Length": 5.7,
"Sepal.Width": 2.6,
"Petal.Length": 3.5,
"Petal.Width": 1,
"Species": "versicolor"
},
{
"Sepal.Length": 5.5,
"Sepal.Width": 2.4,
"Petal.Length": 3.8,
"Petal.Width": 1.1,
"Species": "versicolor"
},
{
"Sepal.Length": 5.5,
"Sepal.Width": 2.4,
"Petal.Length": 3.7,
"Petal.Width": 1,
"Species": "versicolor"
},
{
"Sepal.Length": 5.8,
"Sepal.Width": 2.7,
"Petal.Length": 3.9,
"Petal.Width": 1.2,
"Species": "versicolor"
},
{
"Sepal.Length": 6,
"Sepal.Width": 2.7,
"Petal.Length": 5.1,
"Petal.Width": 1.6,
"Species": "versicolor"
},
{
"Sepal.Length": 5.4,
"Sepal.Width": 3,
"Petal.Length": 4.5,
"Petal.Width": 1.5,
"Species": "versicolor"
},
{
"Sepal.Length": 6,
"Sepal.Width": 3.4,
"Petal.Length": 4.5,
"Petal.Width": 1.6,
"Species": "versicolor"
},
{
"Sepal.Length": 6.7,
"Sepal.Width": 3.1,
"Petal.Length": 4.7,
"Petal.Width": 1.5,
"Species": "versicolor"
},
{
"Sepal.Length": 6.3,
"Sepal.Width": 2.3,
"Petal.Length": 4.4,
"Petal.Width": 1.3,
"Species": "versicolor"
},
{
"Sepal.Length": 5.6,
"Sepal.Width": 3,
"Petal.Length": 4.1,
"Petal.Width": 1.3,
"Species": "versicolor"
},
{
"Sepal.Length": 5.5,
"Sepal.Width": 2.5,
"Petal.Length": 4,
"Petal.Width": 1.3,
"Species": "versicolor"
},
{
"Sepal.Length": 5.5,
"Sepal.Width": 2.6,
"Petal.Length": 4.4,
"Petal.Width": 1.2,
"Species": "versicolor"
},
{
"Sepal.Length": 6.1,
"Sepal.Width": 3,
"Petal.Length": 4.6,
"Petal.Width": 1.4,
"Species": "versicolor"
},
{
"Sepal.Length": 5.8,
"Sepal.Width": 2.6,
"Petal.Length": 4,
"Petal.Width": 1.2,
"Species": "versicolor"
},
{
"Sepal.Length": 5,
"Sepal.Width": 2.3,
"Petal.Length": 3.3,
"Petal.Width": 1,
"Species": "versicolor"
},
{
"Sepal.Length": 5.6,
"Sepal.Width": 2.7,
"Petal.Length": 4.2,
"Petal.Width": 1.3,
"Species": "versicolor"
},
{
"Sepal.Length": 5.7,
"Sepal.Width": 3,
"Petal.Length": 4.2,
"Petal.Width": 1.2,
"Species": "versicolor"
},
{
"Sepal.Length": 5.7,
"Sepal.Width": 2.9,
"Petal.Length": 4.2,
"Petal.Width": 1.3,
"Species": "versicolor"
},
{
"Sepal.Length": 6.2,
"Sepal.Width": 2.9,
"Petal.Length": 4.3,
"Petal.Width": 1.3,
"Species": "versicolor"
},
{
"Sepal.Length": 5.1,
"Sepal.Width": 2.5,
"Petal.Length": 3,
"Petal.Width": 1.1,
"Species": "versicolor"
},
{
"Sepal.Length": 5.7,
"Sepal.Width": 2.8,
"Petal.Length": 4.1,
"Petal.Width": 1.3,
"Species": "versicolor"
},
{
"Sepal.Length": 6.3,
"Sepal.Width": 3.3,
"Petal.Length": 6,
"Petal.Width": 2.5,
"Species": "virginica"
},
{
"Sepal.Length": 5.8,
"Sepal.Width": 2.7,
"Petal.Length": 5.1,
"Petal.Width": 1.9,
"Species": "virginica"
},
{
"Sepal.Length": 7.1,
"Sepal.Width": 3,
"Petal.Length": 5.9,
"Petal.Width": 2.1,
"Species": "virginica"
},
{
"Sepal.Length": 6.3,
"Sepal.Width": 2.9,
"Petal.Length": 5.6,
"Petal.Width": 1.8,
"Species": "virginica"
},
{
"Sepal.Length": 6.5,
"Sepal.Width": 3,
"Petal.Length": 5.8,
"Petal.Width": 2.2,
"Species": "virginica"
},
{
"Sepal.Length": 7.6,
"Sepal.Width": 3,
"Petal.Length": 6.6,
"Petal.Width": 2.1,
"Species": "virginica"
},
{
"Sepal.Length": 4.9,
"Sepal.Width": 2.5,
"Petal.Length": 4.5,
"Petal.Width": 1.7,
"Species": "virginica"
},
{
"Sepal.Length": 7.3,
"Sepal.Width": 2.9,
"Petal.Length": 6.3,
"Petal.Width": 1.8,
"Species": "virginica"
},
{
"Sepal.Length": 6.7,
"Sepal.Width": 2.5,
"Petal.Length": 5.8,
"Petal.Width": 1.8,
"Species": "virginica"
},
{
"Sepal.Length": 7.2,
"Sepal.Width": 3.6,
"Petal.Length": 6.1,
"Petal.Width": 2.5,
"Species": "virginica"
},
{
"Sepal.Length": 6.5,
"Sepal.Width": 3.2,
"Petal.Length": 5.1,
"Petal.Width": 2,
"Species": "virginica"
},
{
"Sepal.Length": 6.4,
"Sepal.Width": 2.7,
"Petal.Length": 5.3,
"Petal.Width": 1.9,
"Species": "virginica"
},
{
"Sepal.Length": 6.8,
"Sepal.Width": 3,
"Petal.Length": 5.5,
"Petal.Width": 2.1,
"Species": "virginica"
},
{
"Sepal.Length": 5.7,
"Sepal.Width": 2.5,
"Petal.Length": 5,
"Petal.Width": 2,
"Species": "virginica"
},
{
"Sepal.Length": 5.8,
"Sepal.Width": 2.8,
"Petal.Length": 5.1,
"Petal.Width": 2.4,
"Species": "virginica"
},
{
"Sepal.Length": 6.4,
"Sepal.Width": 3.2,
"Petal.Length": 5.3,
"Petal.Width": 2.3,
"Species": "virginica"
},
{
"Sepal.Length": 6.5,
"Sepal.Width": 3,
"Petal.Length": 5.5,
"Petal.Width": 1.8,
"Species": "virginica"
},
{
"Sepal.Length": 7.7,
"Sepal.Width": 3.8,
"Petal.Length": 6.7,
"Petal.Width": 2.2,
"Species": "virginica"
},
{
"Sepal.Length": 7.7,
"Sepal.Width": 2.6,
"Petal.Length": 6.9,
"Petal.Width": 2.3,
"Species": "virginica"
},
{
"Sepal.Length": 6,
"Sepal.Width": 2.2,
"Petal.Length": 5,
"Petal.Width": 1.5,
"Species": "virginica"
},
{
"Sepal.Length": 6.9,
"Sepal.Width": 3.2,
"Petal.Length": 5.7,
"Petal.Width": 2.3,
"Species": "virginica"
},
{
"Sepal.Length": 5.6,
"Sepal.Width": 2.8,
"Petal.Length": 4.9,
"Petal.Width": 2,
"Species": "virginica"
},
{
"Sepal.Length": 7.7,
"Sepal.Width": 2.8,
"Petal.Length": 6.7,
"Petal.Width": 2,
"Species": "virginica"
},
{
"Sepal.Length": 6.3,
"Sepal.Width": 2.7,
"Petal.Length": 4.9,
"Petal.Width": 1.8,
"Species": "virginica"
},
{
"Sepal.Length": 6.7,
"Sepal.Width": 3.3,
"Petal.Length": 5.7,
"Petal.Width": 2.1,
"Species": "virginica"
},
{
"Sepal.Length": 7.2,
"Sepal.Width": 3.2,
"Petal.Length": 6,
"Petal.Width": 1.8,
"Species": "virginica"
},
{
"Sepal.Length": 6.2,
"Sepal.Width": 2.8,
"Petal.Length": 4.8,
"Petal.Width": 1.8,
"Species": "virginica"
},
{
"Sepal.Length": 6.1,
"Sepal.Width": 3,
"Petal.Length": 4.9,
"Petal.Width": 1.8,
"Species": "virginica"
},
{
"Sepal.Length": 6.4,
"Sepal.Width": 2.8,
"Petal.Length": 5.6,
"Petal.Width": 2.1,
"Species": "virginica"
},
{
"Sepal.Length": 7.2,
"Sepal.Width": 3,
"Petal.Length": 5.8,
"Petal.Width": 1.6,
"Species": "virginica"
},
{
"Sepal.Length": 7.4,
"Sepal.Width": 2.8,
"Petal.Length": 6.1,
"Petal.Width": 1.9,
"Species": "virginica"
},
{
"Sepal.Length": 7.9,
"Sepal.Width": 3.8,
"Petal.Length": 6.4,
"Petal.Width": 2,
"Species": "virginica"
},
{
"Sepal.Length": 6.4,
"Sepal.Width": 2.8,
"Petal.Length": 5.6,
"Petal.Width": 2.2,
"Species": "virginica"
},
{
"Sepal.Length": 6.3,
"Sepal.Width": 2.8,
"Petal.Length": 5.1,
"Petal.Width": 1.5,
"Species": "virginica"
},
{
"Sepal.Length": 6.1,
"Sepal.Width": 2.6,
"Petal.Length": 5.6,
"Petal.Width": 1.4,
"Species": "virginica"
},
{
"Sepal.Length": 7.7,
"Sepal.Width": 3,
"Petal.Length": 6.1,
"Petal.Width": 2.3,
"Species": "virginica"
},
{
"Sepal.Length": 6.3,
"Sepal.Width": 3.4,
"Petal.Length": 5.6,
"Petal.Width": 2.4,
"Species": "virginica"
},
{
"Sepal.Length": 6.4,
"Sepal.Width": 3.1,
"Petal.Length": 5.5,
"Petal.Width": 1.8,
"Species": "virginica"
},
{
"Sepal.Length": 6,
"Sepal.Width": 3,
"Petal.Length": 4.8,
"Petal.Width": 1.8,
"Species": "virginica"
},
{
"Sepal.Length": 6.9,
"Sepal.Width": 3.1,
"Petal.Length": 5.4,
"Petal.Width": 2.1,
"Species": "virginica"
},
{
"Sepal.Length": 6.7,
"Sepal.Width": 3.1,
"Petal.Length": 5.6,
"Petal.Width": 2.4,
"Species": "virginica"
},
{
"Sepal.Length": 6.9,
"Sepal.Width": 3.1,
"Petal.Length": 5.1,
"Petal.Width": 2.3,
"Species": "virginica"
},
{
"Sepal.Length": 5.8,
"Sepal.Width": 2.7,
"Petal.Length": 5.1,
"Petal.Width": 1.9,
"Species": "virginica"
},
{
"Sepal.Length": 6.8,
"Sepal.Width": 3.2,
"Petal.Length": 5.9,
"Petal.Width": 2.3,
"Species": "virginica"
},
{
"Sepal.Length": 6.7,
"Sepal.Width": 3.3,
"Petal.Length": 5.7,
"Petal.Width": 2.5,
"Species": "virginica"
},
{
"Sepal.Length": 6.7,
"Sepal.Width": 3,
"Petal.Length": 5.2,
"Petal.Width": 2.3,
"Species": "virginica"
},
{
"Sepal.Length": 6.3,
"Sepal.Width": 2.5,
"Petal.Length": 5,
"Petal.Width": 1.9,
"Species": "virginica"
},
{
"Sepal.Length": 6.5,
"Sepal.Width": 3,
"Petal.Length": 5.2,
"Petal.Width": 2,
"Species": "virginica"
},
{
"Sepal.Length": 6.2,
"Sepal.Width": 3.4,
"Petal.Length": 5.4,
"Petal.Width": 2.3,
"Species": "virginica"
},
{
"Sepal.Length": 5.9,
"Sepal.Width": 3,
"Petal.Length": 5.1,
"Petal.Width": 1.8,
"Species": "virginica"
}
]
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment