You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
p9ew5o3q7/app/static/js/confirmedRelative_top7.js

57 lines
1.3 KiB

var MyChart5 = echarts.init(document.getElementById('main5'))
//画新增确诊分布top7柱状图代码
var option5 = {
title:{
text: '新增确诊分布(不包括港澳台地区)',
subtext: ''
},
tooltip : {
show:true,
trigger:'axis',
axisPointer:{type:'shadow'}
},
xAxis: {
type: 'category',
data: [] //top7省份名称
},
yAxis: {
type: 'value'
},
series: [
{
data: [], //top7省份数据
type: 'bar',
showBackground: true,
backgroundStyle: {
color: 'rgba(220, 220, 220, 0.8)'
},
color:'rgba(227, 105, 61, 1)',
barWidth : 20
},
],
legend:{},
};
$.ajax({
cache:false,
type:"GET",
url:"/ProvinceConfirmedRelative_top7",
data:null,
dataType:"json",
async:false,
error:function(request){
alert("发送请求失败!5");
},
success:function(result){
console.info(result)
option5.title.subtext = "数据更新时间:"+result.pub_date
option5.xAxis.data=result.privinces
option5.series[0].data = result.confirmedrelative
}
});
MyChart5.setOption(option5);