2017-06-15 5 views
2

@potatopeelingsのthis helpful answerに基づいてライン付きエリア範囲(ストライプ)チャートを作成しました。ChartJS v2.6の更新で、カスタムライン付き範囲(ストライプ)チャートが破損する

ChartJS v2.1に基づいており、ChartJS v2.6に更新すると、他の要件(注釈)に必要なカスタムチャートタイプが壊れます。

ChartJSv2.1 - http://jsfiddle.net/u20cfpcd/

ChartJSv2.6 - http://jsfiddle.net/cjweb/99nc8atn/

これらの行は破る:

Chart.elements.Line.prototype.lineToNextPoint.apply(...)

Chart.controllers.line.prototype.updateBezierControlPoints.apply(...)

私はLineプロトタイプが今では 'draw'を使うべきだと思いますが、私はそれを解決できません。

お願いします。私はあなたにビッグ・ギャルプを買うよ! ;)

+0

私は 'はconsole.log(Chart.elements.Line.prototype)を加え;'とそれはそう'lineToNextPoint'関数が' prototype'から削除されました。 –

答えて

0

Worked it out。

lineToNextPoint()は廃止され、lineTo()ヘルパーを使用できます。

そう...

Chart.elements.Line.prototype.lineToNextPoint.apply({ _chart: { ctx: ctx } }, [previous, point, next, null, null])

...に置き換えられます。

helpers.canvas.lineTo(ctx, previous._view, point._view); 
関連する問題