const data = [
[
1477920600000,
113,
113,
113,
113
],
[
1478007000000,
113,
113,
113,
113
],
[
1478093400000,
113,
113,
113,
113
],
[
1478179800000,
110.98,
111.46,
109.55,
109.83
],
[
1478266200000,
108.53,
110.25,
108.11,
108.84
],
[
1478529000000,
110.08,
110.51,
109.46,
110.41
],
[
1478615400000,
110.31,
111.72,
109.7,
111.06
],
[
1478701800000,
109.88,
111.32,
108.05,
110.88
],
[
1478788200000,
111.09,
111.09,
105.83,
107.79
],
[
1478874600000,
107.12,
108.87,
106.55,
108.43
],
[
1479133800000,
107.71,
107.81,
104.08,
105.71
],
[
1479220200000,
106.57,
107.68,
106.16,
107.11
],]
// create the chart
Highcharts.stockChart('container', {
chart: {
events: {
render: function() {
let points = this.series[0].points;
for(let i = 0; i < points.length; i++) {
if(points[i].open == points[i].close) {
points[i].graphic.element.classList.replace('highcharts-point-down','highcharts-point-up')
}
}
}
}
},
rangeSelector: {
selected: 1
},
title: {
text: 'AAPL Stock Price'
},
series: [{
type: 'candlestick',
name: 'AAPL Stock Price',
data: data,
}]
});
.highcharts-point-down {
fill: red;
stroke: red;
}
.highcharts-point-up {
stroke: green;
}
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
<div id="container" style="height: 400px; min-width: 310px"></div>