chart.series[name].remove()
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/data.js"></script>
<div id="container" style="min-width: 400px; height: 550px; margin: 0 auto"></div>
<button id="button_natural" class="autocompare">Show Natural Sum</button>
<button id="button_human" class="autocompare">Show Human Sum</button>
<pre id="csv" style="display:none">
</pre>
JavaScript
$(function() {
$('#container').highcharts({
chart: {
renderTo: "container",
type: "spline",
marginLeft: 40,
marginBottom: 60,
marginTop: 100,
marginRight: 200,
alignTicks: false,
animation: {
duration: 1000
}
},
colors: ['#80b1d3', '#7d7d7d', '#d1d756', '#fccde5', '#bebada', '#b3de69', '#fdb462', '#fb8072', '#8dd3c7', '#d34dcb'],
title: {
text: "xxx",
align: "center",
y: 20,
x: 0,
style: {
fontSize: "28px",
color: (Highcharts.theme && Highcharts.theme.textColor) || "black"
}
},
subtitle: {
text: "",
align: "center",
x: -40,
style: {
fontSize: "13px",
color: "#666666"
}
},
xAxis: {
tickWidth: 0
},
yAxis: {
title: {
text: "xxx",
align: "high",
rotation: 0,
textAlign: 'left',
x: 10,
y: -20,
style: {
fontWeight: "bold"
}
},
gridLineWidth: 0,
min: -0.5,
max: 1.1
},
credits: {
href: "",
text: "",
position: {
x: -185
},
style: {
fontSize: "8px",
color: "#666666"
}
},
legend: {
enabled: false,
layout: "vertical",
align: "right",
verticalAlign: "top",
y: 55,
reversed: true,
itemStyle: {
color: '#777',
fontWeight: 'normal',
fontSize: '12px'
}
},
...