SO_Highstock_Scatter Symbol
http://stackoverflow.com/questions/12561240/how-to-change-scatter-symbol-url-of-a-highstock-with-a-function
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
JavaScript
var data = [
[161.2, 51.6],
[167.5, 59.0],
[159.5, 49.2],
[157.0, 63.0],
[155.8, 53.6]
];
data = $.map(data, function (point) {
return {
x: point[0],
y: point[1],
marker: {
radius: 3,
symbol: point[1] < 50 ?
'triangle' :
'square'
}
};
});
$(function () {
var chart;
$(document).ready(function () {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'scatter',
zoomType: 'xy'
},
title: {
text: 'Scatter Graph Demo'
},
xAxis: {
title: {
enabled: true,
text: 'Height (cm)'
},
startOnTick: true,
endOnTick: true,
showLastLabel: true
},
yAxis: {
title: {
text: 'Weight (kg)'
}
},
tooltip: {
formatter: function () {
return '' + this.x + ' cm, ' + this.y + ' kg';
}
},
series: [{
name: 'Points',
color: 'rgba(223, 83, 83, .5)',
data: data
}]
});
});
});