jQuery toggleClass example
Toggle class name on click in jQuery
HTML
<head>
<script src="https://code.highcharts.com/highcharts.js"></script>
</head>
<div id="container" style="height: 400px"></div>
<div id="container2" style="height: 400px"></div>
<script>
const chart = Highcharts.chart('container', {
//plot options code with type: 'datetime'
plotOptions: {
series: {
pointStart: Date.UTC(2020, 2, 4),
pointInterval: 24 * 3600 * 1000
}
},
type: 'line',
tooltip: {
shared: true,
split: false,
enabled: true,
},
xAxis: {
type: 'datetime'
},
series: [{
data: [1,2,3,4,5],
},
{
data: [5,15,20,10,1],
}]
});
</script>
<script>const chart2 = Highcharts.chart('container2', {
//plot options code with type: 'datetime'
plotOptions: {
series: {
pointStart: Date.UTC(2020, 2, 4),
pointInterval: 24 * 3600 * 1000
}
},
type: 'line',
tooltip: {
shared: true,
split: false,
enabled: true,
},
xAxis: {
type: 'datetime'
},
series: [{
data: [5,2,1.5,1,0.9],
},
{
data: [13,15,20,30,11],
}]
});
</script>