Same width scales in two independent charts (Fixed scale step width)
Hi guys,
I'd like to make two different type charts, with same y-axis scale width.
What I've got already.

What I'm trying to achieve:

Is there a way to have same width scales on two different charts ?
@mdopieralski which version are you using?
Hi @etimberg, I use v 2.1.4.
Is it possible to post a fiddle of what you have so far?
I'm also trying to do this (in v2). I've tried setting the paddingLeft etc. properties on the scales and fudging setting the minSize structure.. but they don't seem to have any effect.
I have 2 y-axis scales on 2 charts one above the other but with different labels and I'd just like to be able to align the actual data section of the charts to each other somehow.
Charts seems to always do a best-fit and I appreciate that for it to work with 2 charts they'd need to agree on how wide the scale should be - so I'm just looking to either fix the width of the scale, or fix the draw-area for the chart itself.
I found a fiddle here which creates a new chart type and overrides the draw function (v1 charts) but wondering if this is still the right way to achieve this? http://jsfiddle.net/2kmf10hg/
Thanks a lot
Got it working now. The "afterFit" callback passes a scale which has a calculated "width" property on it. You can override it at that point to force it to a certain width:
options: {
scales: {
xAxes: [{
}],
yAxes: [
{
id: 'yAxis1',
position: 'left',
afterFit: function (scale) {
scale.width = scaleWidth;
},
}
]
}
};
Closing since there was a good answer from @olliholliday