I need to draw arrow of my line chart but i don\'t know well, here there are my code that make arrow http://jsfiddle.net/VQyVs/ I have probleme with serie 2
The problem is with the overriding of the original value for angle:
angle = Math.PI+angle;
Should be:
if (lastPoint.plotX > nextLastPoint.plotX){
if (angle < 0) angle = Math.PI + angle;
}
else{
if (angle > 0) angle = Math.PI + angle;
}
Mark's point about the direction of the line was correct but the proposed solution did not always work depending on the slope of the last two points of the line.
See fiddle