chartist-js / chartist

Simple responsive charts
https://chartist.dev
MIT License
13.34k stars 2.53k forks source link

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

Open hafezdivandari opened 4 years ago

hafezdivandari commented 4 years ago

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

Arantiryo commented 2 years ago

Hi @hafezdivandari

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

hafezdivandari commented 1 year ago

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.

Arantiryo commented 1 year ago

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

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

hafezdivandari commented 1 year ago

@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.