How to change iFrame width and height with API Parameters

Hi there, I’m currently trying to change a specific iFrame width and height.
I’m using a POST API to generate and customize the chart, and then post it. Here’s an example:

'chart': {
    'type': 'bar',
    'width': 2000,
    'height': 1200,
    'data': {
        'labels': ['Q1', 'Q2', 'Q3', 'Q4'],
        'datasets': [{
            'backgroundColor': 'rgb(75, 192, 192)',
            'data': [100, 200, 300, 400]

So, ideally, I would pass the Chart’s width and height trough this POST url, however, I don’t see any results.

I noticed that if I change the iFrame’s width and height, like the following example, it does change the Chart size, but maintains the aspect ratio (does not adapt do the given sizes).

<iframe id="gf1" frameborder="0" width="2000" height="1200"></iframe>

Is there an alternative or am I doing something wrong?

Hi @Diogo.Torres.eGDS,

I think you may need to use the maintainAspectRatio or responsive options. See Chart.js docs here: Responsive Charts | Chart.js

Specifically, I think you’ll have to set maintainAspectRatio to false.