|
|
|
@ -48,13 +48,110 @@ var test_data = stream_layers(3,12,.1).map(function(data, i) {
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var selector = '#chart1',
|
|
|
|
|
chart = nv.models.multiBarHorizontalWithLegend(),
|
|
|
|
|
data = test_data,
|
|
|
|
|
xTickFormat = d3.format(',r'),
|
|
|
|
|
yTickFormat = d3.format(',.2f'),
|
|
|
|
|
xAxisLabel = null,
|
|
|
|
|
yAxisLabel = null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
long_short_data = [
|
|
|
|
|
{
|
|
|
|
|
key: 'Short',
|
|
|
|
|
color: '#d62728',
|
|
|
|
|
values: [
|
|
|
|
|
{
|
|
|
|
|
"label" : "Information Technology" ,
|
|
|
|
|
"y" : -1.8746444827653
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Consumer Discretionary" ,
|
|
|
|
|
"y" : -8.0961543492239
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Health Care" ,
|
|
|
|
|
"y" : -0.57072943117674
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Consumer Staples" ,
|
|
|
|
|
"y" : -2.4174010336624
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Financials" ,
|
|
|
|
|
"y" : -0.72009071426284
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Industrials" ,
|
|
|
|
|
"y" : -0.77154485523777
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Energy" ,
|
|
|
|
|
"y" : -0.90152097798131
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Materials" ,
|
|
|
|
|
"y" : -0.91445417330854
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Telecommunication Services" ,
|
|
|
|
|
"y" : -0.055746319141851
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'Long',
|
|
|
|
|
color: '#1f77b4',
|
|
|
|
|
values: [
|
|
|
|
|
{
|
|
|
|
|
"label" : "Information Technology" ,
|
|
|
|
|
"y" : 25.307646510375
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Consumer Discretionary" ,
|
|
|
|
|
"y" : 16.756779544553
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Health Care" ,
|
|
|
|
|
"y" : 18.451534877007
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Consumer Staples" ,
|
|
|
|
|
"y" : 8.6142352811805
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Financials" ,
|
|
|
|
|
"y" : 7.8082472075876
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Industrials" ,
|
|
|
|
|
"y" : 5.259101026956
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Energy" ,
|
|
|
|
|
"y" : 0.30947953487127
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Materials" ,
|
|
|
|
|
"y" : 0
|
|
|
|
|
} ,
|
|
|
|
|
{
|
|
|
|
|
"label" : "Telecommunication Services" ,
|
|
|
|
|
"y" : 0
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var selector = '#chart1',
|
|
|
|
|
chart = nv.models.multiBarHorizontalWithLegend()
|
|
|
|
|
.x(function(d) { return d.label })
|
|
|
|
|
.margin({top: 30, right: 20, bottom: 50, left: 160})
|
|
|
|
|
.showControls(false)
|
|
|
|
|
.forceY([0]),
|
|
|
|
|
data = long_short_data,
|
|
|
|
|
//data = test_data,
|
|
|
|
|
xTickFormat = function(d) { return d },
|
|
|
|
|
//xTickFormat = d3.format(',r'),
|
|
|
|
|
yTickFormat = d3.format(',.2f'),
|
|
|
|
|
xAxisLabel = null,
|
|
|
|
|
yAxisLabel = null,
|
|
|
|
|
duration = 500;
|
|
|
|
|
|
|
|
|
|
nv.addGraph({
|
|
|
|
|