niloch / iplotter

JavaScript charting in ipython/jupyter notebooks -
http://niloch.github.io/iplotter/
MIT License
85 stars 10 forks source link

Scroll bars showing on ChartJS chart #7

Closed drkane closed 7 years ago

drkane commented 7 years ago

Firefox 51.0.1, Windows 10 (also appears on Chrome 56.0.2924.87)

The chart iframe for a ChartJS chart is the same size as the chart itself, and so scrollbars are appearing at each side.

I played around with the height and width on the iframe and found that a height of 516 (width the same) gets rid of the scroll bars. Might be solved by adding 5% to the chart width and height values for the iframe.

capture

drkane commented 7 years ago

Thanks for the fix - really appreciated.

I saw you've updated the ChartJS library to version 2 too - this is also excellent. I was getting flickering charts in ipython notebooks which I think was caused by the chart trying to resize between the iframe and canvas and getting stuck in a loop.

I came up with a workaround which is to add {"responsive": False} to the options parameter when plotting the chart, but there may be a way to set that as the default option in the code.