1
我希望我的圖表具有固定y軸的水平滾動。 找到像這樣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);
}});
爲1節,但代碼似乎是第2版
不同我沒有看到這樣的參數或選項的文檔。有任何想法嗎?