Created
February 3, 2015 10:09
-
-
Save vongohren/4208f50b7c55c7b33ae8 to your computer and use it in GitHub Desktop.
selve chart optiosn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.createPlot = function(container, data, name) { | |
return chart1 = new Highcharts.Chart({ | |
chart: { | |
renderTo: container, | |
zoomType: 'x' | |
}, | |
title: { | |
text: name.charAt(0).toUpperCase() + name.substring(1)+'´s Moisture levels' | |
}, | |
subtitle: { | |
text: document.ontouchstart === undefined ? | |
'Click and drag in the plot area to zoom in' : | |
'Pinch the chart to zoom in' | |
}, | |
xAxis: { | |
type: 'datetime', | |
tickPixelInterval: 2000, | |
}, | |
yAxis: { | |
title: { | |
text: 'Moisture' | |
} | |
}, | |
legend: { | |
enabled: false | |
}, | |
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 | |
} | |
}, | |
series: [{ | |
type: 'area', | |
name: 'Moisture', | |
data: data | |
}] | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment