Chart.js-RangeSlider icon indicating copy to clipboard operation
Chart.js-RangeSlider copied to clipboard

RangeSlided chart size is huge compared to regular

Open Lambik opened this issue 8 years ago • 5 comments
trafficstars

Hi,

When I use the regular new Chart(), my chart has a 'normal' size, but when I use the new RangeSliderChart() with the same chart options, it's a lot taller and spaced out. What could be the cause?

Best regards, Tom

Lambik avatar Nov 15 '17 12:11 Lambik

I'm not sure, are you able to post a codependent/jsfiddle to demonstrate both the erroneous effect and the correct one?

On 15 Nov. 2017 10:30 pm, "Tom Muylle" [email protected] wrote:

Hi,

When I use the regular new Chart(), my chart has a 'normal' size, but when I use the new RangeSliderChart() with the same chart options, it's a lot taller and spaced out. What could be the cause?

Best regards, Tom

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/schme16/Chart.js-RangeSlider/issues/10, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHFca3ydL_jyS1mE12t27F3ASQrjPM4ks5s2tlJgaJpZM4Qe2nX .

schme16 avatar Nov 16 '17 14:11 schme16

I started from the demo fiddle on your readme, and ended up with this one: https://jsfiddle.net/ut1d21mx/

I had to change the options a little to reflect what I need in my project, and it's those that cause the difference in rendering apparently.

Lambik avatar Nov 17 '17 10:11 Lambik

Well, it's because "maintainAspectRatio" causes everything to increase in size because of the slider bar having a forced width, thereby increasing the width of the canvas, or something. But even when I set it to false, the canvas is still wider than what is set in the html attribute...

Lambik avatar Nov 17 '17 10:11 Lambik

@Lambik: Thanks for that, I'll try and have a fix rolled out soon, and push it to bower and npm when I do

schme16 avatar Nov 21 '17 00:11 schme16

Any news about this? I could still use it :-) But don't want to push you or anything

Lambik avatar Jan 19 '18 12:01 Lambik