Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

highcharts width is bigger than the width of the parent element in angular-material. #589

Open
inakrin opened this issue May 2, 2017 · 3 comments

Comments

@inakrin
Copy link

inakrin commented May 2, 2017

In some case with of the chart is bigger than the width of the parent element. Solution with $timeout doesn't help.

Link to jsfiddle showing the issue.

https://plnkr.co/edit/S6GbzUwmERHY7XkMMZ7c?p=preview

@houssemba
Copy link
Contributor

I think that you need to include the highcharts-ng.css file to fix this problem.

@inakrin
Copy link
Author

inakrin commented May 4, 2017

It fixed the view on plunkr but in my project width is still slightly bigger than the parent container, trying to figure why.
Anyway, could you list highcharts-ng.css among main files in bower.json, because it was ignored by bower_concat task.

@optikool
Copy link

Hi,

I am also having this issue with highcharts-ng. This only happens on some of my charts. I am including the following modules with highcharts...

"highcharts-ng": "1.0.1",
"highcharts": "5.0.12",
"highcharts-no-data": "https://code.highcharts.com/modules/no-data-to-display.js",
"highcharts-exporting": "https://code.highcharts.com/modules/exporting.js",
"highmaps-proj4": "http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.2.2/proj4.js",
"highmaps-map": "https://code.highcharts.com/maps/modules/map.js",
"highmaps-more": "https://code.highcharts.com/highcharts-more.js",
"highmaps-data": "https://code.highcharts.com/modules/data.js",
"highmaps-us": "https://code.highcharts.com/mapdata/countries/us/us-all.js"

I tried updating to your latest version, which broke everything at that point. I ended up adding a width attribute to your bindings as an option and if set will call ctrl.chart.setSize(ctrl.width);. Everything worked perfectly after that.

Because I'd rather not use a hacked version of your directive in case there are updates, what are the changes you could add width and height as an attribute to be set in your directive?

Thanks

Changed code
`bindings: {
config: '<',
changeDetection: '<',
width: '<'
},

ctrl.chart = new HighchartsgetChartType(mergedConfig);
if(ctrl.width) {
ctrl.chart.setSize(ctrl.width);
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants