Chartist-js: Pie chart size

Created on 22 Jan 2017  路  2Comments  路  Source: gionkunz/chartist-js

Creating a pie chart inside a bootstrap col-md-4 gives me some problems when it comes to the actual size of the chart. I can clearly see that width is set to 100%, but it doesn't really fill out everything. I can't seem to figure out what the issue lies. I've tried to override the width in the options object of the chart, but it doesn't seem to make any difference.

Basically I'd like the width to be 100% and the height to be automatic, thus filling out the entire col-md-4 width that the element has available.

pie-chart-size

Further information.

Here's the HTML markup:

<div class="col-md-4" id="#users">
    <svg xmlns:ct="http://gionkunz.github.com/chartist-js/ct" width="100%" height="100%" class="ct-chart-pie" style="width: 100%; height: 100%;">...</svg>
</div>

Most helpful comment

Just use a chart container with the ct-square class:

<div class="col-md-4" id="#users">
    <div class="ct-chart ct-square"></div>
</div>

All 2 comments

Just use a chart container with the ct-square class:

<div class="col-md-4" id="#users">
    <div class="ct-chart ct-square"></div>
</div>

Did the job. Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jbwl picture jbwl  路  4Comments

ShlomoRosenheimer picture ShlomoRosenheimer  路  3Comments

balintfarago picture balintfarago  路  3Comments

Globegitter picture Globegitter  路  4Comments

adilbenmoussa picture adilbenmoussa  路  4Comments