1
グラフをy軸固定の水平スクロールで表示したい。 はV.1のため、このhttp://jsfiddle.net/mbhavfwm/Chart.js V2。固定y軸を持つ棒グラフ
new Chart(ctx).Line(data, {
onAnimationComplete: function() {
var sourceCanvas = this.chart.ctx.canvas;
var copyWidth = this.scale.xScalePaddingLeft - 5;
// the +5 is so that the bottommost y axis label is not clipped off
// we could factor this in using measureText if we wanted to be generic
var copyHeight = this.scale.endPoint + 5;
var targetCtx = document.getElementById("myChartAxis").getContext("2d");
targetCtx.canvas.width = copyWidth;
targetCtx.drawImage(sourceCanvas, 0, 0, copyWidth, copyHeight, 0, 0, copyWidth, copyHeight);
}});
のようなものを見つけましたが、コードは、私はドキュメントで、このためのパラメータやオプションが表示されないV.2
に異なるようです。何か案は?