<script src='nvd3/js/jquery-1.8.2.min.js' type='text/javascript'></script>
<script src='nvd3/js/d3.v3.min.js' type='text/javascript'></script>
<script src='nvd3/js/nv.d3.min-new.js' type='text/javascript'></script>
<script src='nvd3/js/fisheye.js' type='text/javascript'></script>
<style>
.rChart {
display: block;
margin-left: auto;
margin-right: auto;
width: 800px;
height: 400px;
}
</style>
<div id = 'chart2d0536b127e' class = 'rChart nvd3'></div>
<script type='text/javascript'>
$(document).ready(function(){ drawchart2d0536b127e() }); function drawchart2d0536b127e(){
var opts = { "dom": "chart2d0536b127e", "width": 800, "height": 400, "x": "Month", "y": "Value", "group": "Type", "type": "multiBarChart", "id": "chart2d0536b127e" }, data = [ { "Month": 1, "Date": "1/1/2013", "Client": "1", "Type": "Trend", "Value": 0.98153 }, { "Month": 2, "Date": "1/2/2013", "Client": "1", "Type": "Trend", "Value": 0.98162 }, { "Month": 3, "Date": "1/3/2013", "Client": "1", "Type": "Trend", "Value": 0.98171 }, { "Month": 4, "Date": "1/4/2013", "Client": "1", "Type": "Trend", "Value": 0.9818 }, { "Month": 5, "Date": "1/5/2013", "Client": "1", "Type": "Trend", "Value": 0.98189 }, { "Month": 6, "Date": "1/6/2013", "Client": "1", "Type": "Trend", "Value": 0.98198 }, { "Month": 7, "Date": "1/7/2013", "Client": "1", "Type": "Trend", "Value": 0.98207 }, { "Month": 8, "Date": "1/8/2013", "Client": "1", "Type": "Trend", "Value": 0.98221 }, { "Month": 9, "Date": "1/9/2013", "Client": "1", "Type": "Trend", "Value": 0.98235 }, { "Month": 10, "Date": "1/10/2013", "Client": "1", "Type": "Trend", "Value": 0.98265 }, { "Month": 11, "Date": "1/11/2013", "Client": "1", "Type": "Trend", "Value": 0.98294 }, { "Month": 12, "Date": "1/12/2013", "Client": "1", "Type": "Trend", "Value": 0.98327 }, { "Month": 13, "Date": "1/1/2014", "Client": "1", "Type": "Trend", "Value": 0.98361 }, { "Month": 14, "Date": "1/2/2014", "Client": "1", "Type": "Trend", "Value": 0.98402 }, { "Month": 15, "Date": "1/3/2014", "Client": "1", "Type": "Trend", "Value": 0.98443 }, { "Month": 16, "Date": "1/4/2014", "Client": "1", "Type": "Trend", "Value": 0.98506 }, { "Month": 17, "Date": "1/5/2014", "Client": "1", "Type": "Trend", "Value": 0.98569 }, { "Month": 18, "Date": "1/6/2014", "Client": "1", "Type": "Trend", "Value": 0.98637 }, { "Month": 19, "Date": "1/7/2014", "Client": "1", "Type": "Trend", "Value": 0.98705 }, { "Month": 20, "Date": "1/8/2014", "Client": "1", "Type": "Trend", "Value": 0.98754 }, { "Month": 21, "Date": "1/9/2014", "Client": "1", "Type": "Trend", "Value": 0.98804 }, { "Month": 22, "Date": "1/10/2014", "Client": "1", "Type": "Trend", "Value": 0.98825 }, { "Month": 23, "Date": "1/11/2014", "Client": "1", "Type": "Trend", "Value": 0.98846 }, { "Month": 24, "Date": "1/12/2014", "Client": "1", "Type": "Trend", "Value": 0.98863 }, { "Month": 25, "Date": "1/1/2015", "Client": "1", "Type": "Trend", "Value": 0.9888 }, { "Month": 26, "Date": "1/2/2015", "Client": "1", "Type": "Trend", "Value": 0.98895 }, { "Month": 27, "Date": "1/3/2015", "Client": "1", "Type": "Trend", "Value": 0.9891 }, { "Month": 28, "Date": "1/4/2015", "Client": "1", "Type": "Trend", "Value": 0.98923 }, { "Month": 29, "Date": "1/5/2015", "Client": "1", "Type": "Trend", "Value": 0.98935 }, { "Month": 30, "Date": "1/6/2015", "Client": "1", "Type": "Trend", "Value": 0.98945 }, { "Month": 1, "Date": "1/1/2013", "Client": "1", "Type": "Seasonal", "Value": -0.00302 }, { "Month": 2, "Date": "1/2/2013", "Client": "1", "Type": "Seasonal", "Value": -0.00149 }, { "Month": 3, "Date": "1/3/2013", "Client": "1", "Type": "Seasonal", "Value": -0.00249 }, { "Month": 4, "Date": "1/4/2013", "Client": "1", "Type": "Seasonal", "Value": -0.00125 }, { "Month": 5, "Date": "1/5/2013", "Client": "1", "Type": "Seasonal", "Value": -0.00282 }, { "Month": 6, "Date": "1/6/2013", "Client": "1", "Type": "Seasonal", "Value": 0.00178 }, { "Month": 7, "Date": "1/7/2013", "Client": "1", "Type": "Seasonal", "Value": 0.00293 }, { "Month": 8, "Date": "1/8/2013", "Client": "1", "Type": "Seasonal", "Value": 0.00282 }, { "Month": 9, "Date": "1/9/2013", "Client": "1", "Type": "Seasonal", "Value": 0.00307 }, { "Month": 10, "Date": "1/10/2013", "Client": "1", "Type": "Seasonal", "Value": 0.00092 }, { "Month": 11, "Date": "1/11/2013", "Client": "1", "Type": "Seasonal", "Value": 0.00197 }, { "Month": 12, "Date": "1/12/2013", "Client": "1", "Type": "Seasonal", "Value": -0.00242 }, { "Month": 13, "Date": "1/1/2014", "Client": "1", "Type": "Seasonal", "Value": -0.00302 }, { "Month": 14, "Date": "1/2/2014", "Client": "1", "Type": "Seasonal", "Value": -0.00149 }, { "Month": 15, "Date": "1/3/2014", "Client": "1", "Type": "Seasonal", "Value": -0.00249 }, { "Month": 16, "Date": "1/4/2014", "Client": "1", "Type": "Seasonal", "Value": -0.00125 }, { "Month": 17, "Date": "1/5/2014", "Client": "1", "Type": "Seasonal", "Value": -0.00282 }, { "Month": 18, "Date": "1/6/2014", "Client": "1", "Type": "Seasonal", "Value": 0.00178 }, { "Month": 19, "Date": "1/7/2014", "Client": "1", "Type": "Seasonal", "Value": 0.00293 }, { "Month": 20, "Date": "1/8/2014", "Client": "1", "Type": "Seasonal", "Value": 0.00282 }, { "Month": 21, "Date": "1/9/2014", "Client": "1", "Type": "Seasonal", "Value": 0.00307 }, { "Month": 22, "Date": "1/10/2014", "Client": "1", "Type": "Seasonal", "Value": 0.00092 }, { "Month": 23, "Date": "1/11/2014", "Client": "1", "Type": "Seasonal", "Value": 0.00197 }, { "Month": 24, "Date": "1/12/2014", "Client": "1", "Type": "Seasonal", "Value": -0.00242 }, { "Month": 25, "Date": "1/1/2015", "Client": "1", "Type": "Seasonal", "Value": -0.00302 }, { "Month": 26, "Date": "1/2/2015", "Client": "1", "Type": "Seasonal", "Value": -0.00149 }, { "Month": 27, "Date": "1/3/2015", "Client": "1", "Type": "Seasonal", "Value": -0.00249 }, { "Month": 28, "Date": "1/4/2015", "Client": "1", "Type": "Seasonal", "Value": -0.00125 }, { "Month": 29, "Date": "1/5/2015", "Client": "1", "Type": "Seasonal", "Value": -0.00282 }, { "Month": 30, "Date": "1/6/2015", "Client": "1", "Type": "Seasonal", "Value": 0.00178 }, { "Month": 1, "Date": "1/1/2013", "Client": "1", "Type": "Remainder", "Value": 0.00149 }, { "Month": 2, "Date": "1/2/2013", "Client": "1", "Type": "Remainder", "Value": 0.00056 }, { "Month": 3, "Date": "1/3/2013", "Client": "1", "Type": "Remainder", "Value": -0.00143 }, { "Month": 4, "Date": "1/4/2013", "Client": "1", "Type": "Remainder", "Value": -0.00245 }, { "Month": 5, "Date": "1/5/2013", "Client": "1", "Type": "Remainder", "Value": -0.00197 }, { "Month": 6, "Date": "1/6/2013", "Client": "1", "Type": "Remainder", "Value": 0.00294 }, { "Month": 7, "Date": "1/7/2013", "Client": "1", "Type": "Remainder", "Value": 0.0023 }, { "Month": 8, "Date": "1/8/2013", "Client": "1", "Type": "Remainder", "Value": 0.00117 }, { "Month": 9, "Date": "1/9/2013", "Client": "1", "Type": "Remainder", "Value": -0.00052 }, { "Month": 10, "Date": "1/10/2013", "Client": "1", "Type": "Remainder", "Value": -0.00236 }, { "Month": 11, "Date": "1/11/2013", "Client": "1", "Type": "Remainder", "Value": 0.00059 }, { "Month": 12, "Date": "1/12/2013", "Client": "1", "Type": "Remainder", "Value": -0.00406 }, { "Month": 13, "Date": "1/1/2014", "Client": "1", "Type": "Remainder", "Value": -0.00179 }, { "Month": 14, "Date": "1/2/2014", "Client": "1", "Type": "Remainder", "Value": -0.00023 }, { "Month": 15, "Date": "1/3/2014", "Client": "1", "Type": "Remainder", "Value": 0.00056 }, { "Month": 16, "Date": "1/4/2014", "Client": "1", "Type": "Remainder", "Value": 0.00279 }, { "Month": 17, "Date": "1/5/2014", "Client": "1", "Type": "Remainder", "Value": 0.00093 }, { "Month": 18, "Date": "1/6/2014", "Client": "1", "Type": "Remainder", "Value": 0.00035 }, { "Month": 19, "Date": "1/7/2014", "Client": "1", "Type": "Remainder", "Value": -0.00227 }, { "Month": 20, "Date": "1/8/2014", "Client": "1", "Type": "Remainder", "Value": -0.00116 }, { "Month": 21, "Date": "1/9/2014", "Client": "1", "Type": "Remainder", "Value": 0.00049 }, { "Month": 22, "Date": "1/10/2014", "Client": "1", "Type": "Remainder", "Value": 0.00233 }, { "Month": 23, "Date": "1/11/2014", "Client": "1", "Type": "Remainder", "Value": -0.00063 }, { "Month": 24, "Date": "1/12/2014", "Client": "1", "Type": "Remainder", "Value": 0.00399 }, { "Month": 25, "Date": "1/1/2015", "Client": "1", "Type": "Remainder", "Value": 0.00042 }, { "Month": 26, "Date": "1/2/2015", "Client": "1", "Type": "Remainder", "Value": -0.00026 }, { "Month": 27, "Date": "1/3/2015", "Client": "1", "Type": "Remainder", "Value": 0.00088 }, { "Month": 28, "Date": "1/4/2015", "Client": "1", "Type": "Remainder", "Value": -0.00038 }, { "Month": 29, "Date": "1/5/2015", "Client": "1", "Type": "Remainder", "Value": 0.00096 }, { "Month": 30, "Date": "1/6/2015", "Client": "1", "Type": "Remainder", "Value": -0.00343 } ]
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>