highcharts / highcharts-vue

Other
686 stars 150 forks source link

Highchart is not scaled correctly #245

Closed sjoshid closed 9 months ago

sjoshid commented 1 year ago

Hi, Im having trouble scaling the chart with its parent div. Here's how it look. image

I have observed that the chart scales correctly on x axis. But not on y. You can try that in the codesandbox link.

What can I do to remove the scrollbars?

FYI: the chart is wihin a Gridstack.

jszuminski commented 1 year ago

Hi,

Thanks for reporting @sjoshid.

The problem you're encountering is not related to highcharts-vue, but more to highcharts and how the chart.height is established.

I've prepared a simple override of the getChartSize function which solves the problem.

Please let me know if that works for you.

Demo: https://codesandbox.io/p/github/sjoshid/Testing-Gridstack-Issue/csb-6dhn3n/draft/peaceful-gwen?file=%2Fsrc%2FApp.vue%3A5%2C1

sjoshid commented 1 year ago

Thanks for creating a fix @jakubSzuminski.

Is there no Vue way to fix the problem? The solution you have works but doesnt sit right in my gut. There should be a cleaner solution. No?

No matter the solution, do you think it makes sense to have it HV?