-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Responsive chart with width and height to 100% #54
Comments
You got it finally? Regards. |
I am facing this issue, I want the charts to be responsive. |
any updates? a version that uses angular flex is nice too |
Check out the page “ https://www.devrandom.it/software/ng2-google-charts/ ”. At the end of the page in the “Advanced usage” section there is a function named “myfunction”, which redraws the chart. Try using such a function hooked on a “resize” event. |
Is there any consensus out there on how to make the chart responsive? The options only takes integer values and interprets it as number of pixels. Setting outside div's width to % value works for the initial display but as was noted above doesn't work when changing the window size. |
Also it seems setting the height of the chart via the outer div doesn't work. The height can only be set via options. |
Did anyone found a solution? |
This - https://codepen.io/flopreynat/pen/BfLkA works for me! |
Hello
I am trying to implement a responsive pie chart with width and height to 100%.
The html code:
<google-chart id="chart" [data]="pieChartData"></google-chart>
The relevant scss code:
and the chartData object:
For some reason setting "100%" in width and height does not work, hard coding those to e.g 350 will not make it responsive.
Although the #chart in my browser ends up to 350 x 350 the enclosed div defaults to 350 x 200
I have tried using "100%" in plain javascript/css/html and it works.
Any idea how to implement a responsive chart or what am am I doing wrong?
The text was updated successfully, but these errors were encountered: