64 lines
1.5 KiB
JavaScript
64 lines
1.5 KiB
JavaScript
Highcharts.chart('container', {
|
|
title: {
|
|
text: 'Financial data'
|
|
},
|
|
|
|
subtitle: {
|
|
text: 'Source: yahoo.com'
|
|
},
|
|
|
|
xAxis: {
|
|
type: 'datetime'
|
|
},
|
|
yAxis: {
|
|
title: {
|
|
text: 'Value'
|
|
}
|
|
},
|
|
plotOptions: {
|
|
area: {
|
|
fillColor: {
|
|
linearGradient: {
|
|
x1: 0,
|
|
y1: 0,
|
|
x2: 0,
|
|
y2: 1
|
|
},
|
|
stops: [
|
|
[0, Highcharts.getOptions().colors[0]],
|
|
[1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
|
|
]
|
|
},
|
|
marker: {
|
|
radius: 2
|
|
},
|
|
lineWidth: 1,
|
|
states: {
|
|
hover: {
|
|
lineWidth: 1
|
|
}
|
|
},
|
|
threshold: null
|
|
}
|
|
},
|
|
legend: {
|
|
layout: 'vertical',
|
|
align: 'right',
|
|
verticalAlign: 'middle'
|
|
},
|
|
|
|
series: [{
|
|
type: 'area',
|
|
name: 'Open',
|
|
data: [
|
|
{{ range .Rows }} [ {{ .Date }}, {{ .Open }} ],
|
|
{{ end }} ]
|
|
},{
|
|
type: 'area',
|
|
name: 'Close',
|
|
data: [
|
|
{{ range .Rows }} [ {{ .Date }}, {{ .Close }} ],
|
|
{{ end }} ]
|
|
}]
|
|
});
|