나는 내 라인 차트의 화살표를 그릴 필요하지만 난 잘 알고, 여기에 내가 시리즈 2화살표
var lineSeries = Highcharts.seriesTypes.line;
var lineDrawGraph = lineSeries.prototype.drawGraph;
lineSeries.prototype.drawGraph = function() {
var arrowLength = 15,
arrowWidth = 9,
series = this,
segments = series.linedata || series.segments,
lastSeg = segments[segments.length - 1],
lastPoint = lastSeg[lastSeg.length - 1],
nextLastPoint = lastSeg[lastSeg.length - 2],
angle = Math.atan((lastPoint.plotX - nextLastPoint.plotX)/
(lastPoint.plotY - nextLastPoint.plotY)),
path = [];
angle = Math.PI+angle;
lineDrawGraph.apply(series, arguments);
path.push('M', lastPoint.plotX, lastPoint.plotY);
path.push(
'L',
lastPoint.plotX + arrowWidth * Math.cos(angle),
lastPoint.plotY - arrowWidth * Math.sin(angle)
);
path.push(
lastPoint.plotX + arrowLength * Math.sin(angle),
lastPoint.plotY + arrowLength * Math.cos(angle)
);
path.push(
lastPoint.plotX - arrowWidth * Math.cos(angle),
lastPoint.plotY + arrowWidth * Math.sin(angle),
'Z'
);
series.chart.renderer.path(path)
.attr({
fill: series.color
})
.add(series.group);
};
수있는 하나 probleme 한 http://jsfiddle.net/VQyVs/ 화살표 만들어 내 코드가없는 도와주세요? 감사합니다
@ 마크 참조 왼쪽에서 오른쪽으로가는 라인 - 지난 두 지점의 기울기가 음수 일 경우 (첫번째 시리즈를 참조 http://jsfiddle.net/f9Lgc /1/). – malonso