chartist icon indicating copy to clipboard operation
chartist copied to clipboard

The chart's minimum width is 300px when it's set to 100%

Open hafezdivandari opened this issue 3 years ago • 4 comments

The chart's width doesn't go below 300px when its width option is set to 100% on chrome: https://jsfiddle.net/hafez/9w5up1b4/

image

hafezdivandari avatar Aug 02 '20 05:08 hafezdivandari

Hi @hafezdivandari

Is the issue still relevant for you? Looks like it works fine with the latest version.

Arantiryo avatar Sep 14 '22 12:09 Arantiryo

Hi @Arantiryo

I tested the latest version and updated the fiddle https://jsfiddle.net/hafez/9w5up1b4/

As you can see on the fiddle, the issue is not fixed yet.

hafezdivandari avatar Oct 15 '22 05:10 hafezdivandari

Looks like using min-width instead of width is the issue.

Setting style="width: 200px;" for container div makes the chart 200px wide.

Arantiryo avatar Nov 03 '22 11:11 Arantiryo

@Arantiryo yeah I know that as a workaround, but I have a complex use case and I've chosen chartist for it's responsive feature. But it seems that 200px width is hardcoded somewhere / somehow in the chartist that is breaking this.

hafezdivandari avatar Nov 05 '22 13:11 hafezdivandari