Hello,
Thanks
Indeed it works on the link (on the other hand the suns are not removed as you go along, so if you touch the navigator too much a lot of markers appear).
On the other hand, when I want to adapt it on my code it does not work. Before digging deeper I already have a problem between this version of the code that works:
Code: Select all
load: function() {
var chart = this,
points = chart.series[0].points,
points2 = chart.series[1].points,
maxValue,
maxValue2,
chosenPoint = chart.series[0].points[0],
chosenPoint2 = chart.series[1].points[0];
points.forEach(function(point, index) {
if (!maxValue || maxValue < point.y) {
maxValue = point.y;
chosenPoint = point;
}
});
points.forEach(function(point2, index) {
if (!maxValue2 || maxValue2 < point2.y) {
maxValue2 = point2.y;
chosenPoint2 = point2;
}
});
chosenPoint.update({
marker: {
enabled:true,
symbol: 'url(https://www.highcharts.com/samples/graphics/sun.png)'
}
});
chosenPoint2.update({
marker: {
enabled:true,
symbol: 'url(https://www.highcharts.com/samples/graphics/sun.png)'
}
});
}
DEMO :
https://raspigournayaronde.sytes.net/Gr ... hique2.php
And the one proposed here that does not work:
Code: Select all
load: function() {
var chart = this,
points = chart.series[0].points,
points2 = chart.series[1].points,
maxValue,
maxValue2,
chosenPoint = chart.series[0].points[0],
chosenPoint2 = chart.series[1].points[0];
points.forEach(function(point, index) {
if (point.y > chosenPoint.y && point.isInside) {
maxValue = point.y;
chosenPoint = point;
}
});
points.forEach(function(point, index) {
if (point.y > chosenPoint2.y && point.isInside) {
maxValue2 = point.y;
chosenPoint2 = point2;
}
});
chosenPoint.update({
marker: {
enabled:true,
symbol: 'url(https://www.highcharts.com/samples/graphics/sun.png)'
}
});
chosenPoint2.update({
marker: {
enabled:true,
symbol: 'url(https://www.highcharts.com/samples/graphics/sun.png)'
}
});
}
DEMO :
https://raspigournayaronde.sytes.net/Gr ... phique.php