Ng2-charts: How to change size of responsive chart?

Created on 22 Oct 2016  路  7Comments  路  Source: valor-software/ng2-charts

I want to set the height of my chart to be a percentage of it's containing div. How do I do this?
It's such a simple question, but if I set the chart responsive: false, then I can stretch it but it is out of proportion, as the underlying height and width are already set.
If I set it as responsive: true then the chart will spill out of the containing div and fill the screen.
If I set the containing div's CSS to contain: content, then I can just see the top of the graph.

What should I do?

Most helpful comment

Is there any solution for this issue?

All 7 comments

Same question here... Some solution?

any solution ?

specificly for this and the line chart ( although a bit wonky ) was to set the height in css on the canvas, width is still a but uncontrolable. setting width will draw the plot far too large on the canvas using the width and height inputs were no help either

Is there any solution for this issue?

Any work around ?

I'm facing this issue too.

Please see this stackblitz for a possible solution: https://stackblitz.com/edit/ng2-charts-dynamic-height

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vmironovs picture vmironovs  路  3Comments

shenriksen4 picture shenriksen4  路  3Comments

SteeledSlagle13 picture SteeledSlagle13  路  3Comments

shyamal890 picture shyamal890  路  4Comments

mrpotato3 picture mrpotato3  路  5Comments