Risk vs Return
Risk vs Return
by verashn
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; max-width: 800px; margin: 0 auto"></div>
JavaScript
$(function () {
Highcharts.setOptions({
colors: ['#203770', '#3d91ce', '#498F8F', '#6E5DA4', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],
lang: {
decimalPoint: '.',
thousandsSeparator: ','
},
chart: {
style: {
fontFamily: 'Source Sans Pro'
}
}
});
$('#container').highcharts({
chart: {
type: 'scatter',
zoomType: 'xy'
},
title: {
text: 'Risk vs. Return'
},
xAxis: {
title: {
enabled: true,
text: 'Risk (Std Dev)'
},
startOnTick: true,
endOnTick: true,
showLastLabel: true
},
yAxis: {
title: {
text: 'Return'
}
},
legend: {
align: 'right',
verticalAlign: 'top',
layout: 'vertical',
x: 0,
y: 100,
backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF',
borderWidth: 1,
borderColor: '#dddddd',
enabled: false
},
plotOptions: {
scatter: {
marker: {
radius: 5,
states: {
hover: {
enabled: true,
lineColor: 'rgb(100,100,100)'
}
}
},
states: {
hover: {
marker: {
enabled: false
}
}
},
tooltip: {
headerFormat: '<b>{series.name}</b><br>',
pointFormat: 'Risk : {point.x}, Return: {point.y}'
}
}
},
series: [{
...