Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
235 views
in Technique[技术] by (71.8m points)

html - bootstrap 3 row height is always 400px

I am trying to get a Highcharts pie chart to display correctly.

<div id="chart">
    <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
        <div id="row-electric" class="row row-chart">
            <div id="divPieSubst" class="col-xs-6 col-sm-6 col-md-6 col-lg-6"></div>
            <div id="divPieFeedr" class="col-xs-6 col-sm-6 col-md-6 col-lg-6"></div>
        </div>
        <div class="row row-chart">
            <div id="divPieCycle" class="col-xs-6 col-sm-6 col-md-6 col-lg-6"></div>
            <div id="divPieRoute" class="col-xs-6 col-sm-6 col-md-6 col-lg-6"></div>
        </div>
    </div>
    <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
        <div id="divBarDays"></div>
    </div>
</div>

row-chart is something I tried to do with some CSS I found:

<style>
    div.row-chart {
        height: auto;
    }
</style>

Currently, I am struggling with the CCS, which I think is caused by bootstrap v3.3.7.

screenshot

Why is it always coming back as a tall rectangle?

I included the Highcharts tag, because this could be something that Highcharts is doing.

question from:https://stackoverflow.com/questions/66053162/bootstrap-3-row-height-is-always-400px

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

In Highcharts API we can read:

height: null, number, string

...

By default (when null) the height is calculated from the offset height of the containing element, or 400 pixels if the containing element's height is 0. Defaults to null.

So yes - the height is set by the chart.


API Reference: https://api.highcharts.com/highcharts/chart.height


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...