echartsの高さはどうなりますか?
/*
*/
// dom, echarts
var myChart = echarts.init(document.getElementById('main'));
//
var option = {
title: {
text: ' top5',
left:'center',
top:'10px',
textStyle: { //
fontSize: 24,
color: '#7f7f7f'
}
},
xAxis: {
data: [" "," "," "," "," "],
axisTick: {
show: false,
},
axisLine: {
show: false
}
},
yAxis: [
{
type: 'value',
min: 0, //
max: 35, //
interval: 5, //
axisTick: {
show: false,
},
axisLine: {
show: false
}
}
],
series: [{
name: ' ',
type: 'bar',
data: [32, 19, 18, 15, 12],
itemStyle: {
normal: {
color: '#4f81bd',
label: {
show: true, //
position: 'top', //
textStyle: { //
color: 'black',
fontSize: 12
}
}
}
}
}]
};
// 。
myChart.setOption(option);
window.onresize = function() {
var h1=document.documentElement.clientHeight;//
if(h1>700){
myChart.getDom().style.height = 65 + "vh";
}else{
myChart.getDom().style.height = 60 + "vh";
}
myChart.resize();
}
util.call(function(h){
//h
var h2=document.documentElement.clientHeight;//
console.log(h2);
if(h2<600){
// echarts
myChart.getDom().style.height = ((h2-h)/2)+70 + "px";
myChart.resize();
}
})