arrow of line chart highcharts

后端 未结 2 660
长情又很酷
长情又很酷 2020-12-22 06:39

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

         


        
2条回答
  •  清酒与你
    2020-12-22 07:36

    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

提交回复
热议问题