gpt4 book ai didi

javascript - 在图表后插入文本 block

转载 作者:行者123 更新时间:2023-12-02 21:36:37 25 4
gpt4 key购买 nike

我的页面上有多个图表,如何确保中间的每个图表后面仍然有文本?

https://jsfiddle.net/0xkq98sv/1/

window.onload = function() {
let container = document.querySelector('.chart-container');

[{"name":"test","description":"test","date":[1577203210000,1577206808000,1577210408000],"profitInBTC":[0.0,-0.79,0.87],"profitInUSDT":[0.0,-0.51,0.36]},{"name":"puz","description":"puz","date":[1582665302212,1582668005727,1582671603990],"profitInBTC":[0.0,-0.5,14.72],"profitInUSDT":[15.4,15.41,15.41]}].forEach(function(snapshot) {

let chartcont = document.createElement('div');
chartcont.className = 'chart';
let desc = document.createElement('div');
desc.className = 'desc-container';
desc.innerHTML = snapshot.description;

container.append(desc);
container.append(chartcont);


var config = createConfig(snapshot);

Highcharts.stockChart(chartcont, config);


});

};

最佳答案

.chart-container{
flex-direction: column;
}

.desc-container {
text-align: center;
display: block;
}

根据你的jsfiddle flex-direction:row;将使用 flex-direction:column 将其子项设置为 row (彼此相邻);会将每个子项显示为一行,全部充当一列。

关于javascript - 在图表后插入文本 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60475672/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com