数据修改

This commit is contained in:
Wjl
2022-01-11 16:41:48 +08:00
parent 37c93d07d0
commit eeff59e481
10 changed files with 490 additions and 94 deletions

View File

@@ -1,14 +1,14 @@
// home页面所有echart图表
//住房价格指数
var url = "http://118.178.224.202:8024/api/h-pindex"
let city_myChart1 = echarts.init(document.querySelector(".cityEchart1"))
$.get(url,function(data){
$.get("http://118.178.224.202:8024/api/h-pindex",function(data){
var d = data.data
var yishou = countTotal(d,'ancHousing')
var ershou = countTotal(d,'csHousing')
$("#yishou").html(yishou)
$("#ershou").html(ershou)
console.log("得到的价格指数的数据",data)
var yishou = countTotal(d,'ancHousing').toFixed(2)
var ershou = countTotal(d,'csHousing').toFixed(2)
/* $("#yishou").html(yishou)
$("#ershou").html(ershou) */
let cityOption1 = {
title: {
text: "",
@@ -26,7 +26,9 @@ $.get(url,function(data){
xAxis: {
type: "category",
boundaryGap: false,
data: ["2021.1", "2", "3", "4", "5", "6", "7"],
data:d.map(function (item) {
return item['month']
}),
axisLabel: {
rotate: 45,
},
@@ -425,41 +427,49 @@ $.post(url7, function (data) {
})
var mubiao2 = countTotal(d, 'targetValue');
var nb_value2 = countTotal(d, 'currentValue');
$("#lejiwc").html(parseFloat(nb_value2).toFixed(2));
$("#wclv").html(parseFloat(nb_value2/mubiao2*100).toFixed(2))
let option02 = {
xAxis: {
type: "value",
// boundaryGap: [0, 0.05],
show: false,
max: 100,
},
yAxis: {
type: "category",
show: false,
},
series: [
{
name: "2021",
type: "bar",
data: [nb_value2/mubiao2*100],
itemStyle: {
color: "#269BFF",
borderRadius: 20,
},
barWidth: "10",
showBackground: true,
backgroundStyle: {
borderRadius: 100,
// color: "red",
},
},
],
}
myChart02.setOption(option02)
})
/* 新建绿道修改 */
$.get("http://118.178.224.202:8024/api/new7",function(data){
console.log("得到的新建绿道数据",data)
$("#lejiwc").html(data.data[0].total5);
$("#wclv").html(data.data[0].finish)
let option02 = {
xAxis: {
type: "value",
// boundaryGap: [0, 0.05],
show: false,
max: 100,
},
yAxis: {
type: "category",
show: false,
},
series: [
{
name: "2021",
type: "bar",
data: [data.data[0].finish],
itemStyle: {
color: "#269BFF",
borderRadius: 20,
},
barWidth: "10",
showBackground: true,
backgroundStyle: {
borderRadius: 100,
// color: "red",
},
},
],
}
myChart02.setOption(option02)
})
@@ -470,9 +480,7 @@ let myChart03 = echarts.init(document.querySelector(".echart03"))
$.get(url6,function(data){
var d = data.data
var kaigongshu = countTotal(d,"aim")
var gaizaoshu = countTotal(d,"started")
$("#kaigongshu").html(kaigongshu)
$("#gaizaoshu").html(gaizaoshu)
let option03 = {
@@ -571,15 +579,17 @@ let option03 = {
}
myChart03.setOption(option03)
})
var url8 = "http://118.178.224.202:8024/api/old-urban2"
let myChart04 = echarts.init(document.querySelector(".echart04"))
$.get(url8,function(data){
var d = data.data
var gaizaoshu = countTotal(d,"aim").toFixed(1)
$("#gaizaoshu").html(gaizaoshu)
let option04 = {
dataZoom: [
{
@@ -1020,7 +1030,7 @@ $.get(url11,function(data){
let myChart09 = echarts.init(document.querySelector(".echart09"))
let url13 = "http://118.178.224.202:8024/api/real-estate"
$.get(url13,function(data){
$("#touzi").html(countTotal(data.data,"investment"))
$("#touzi").html(countTotal(data.data,"investment").toFixed(2))
let option09 = {
dataZoom: [
{
@@ -1219,6 +1229,7 @@ $.get(url15,function(data){
$(".bj").html(data.data[1].number);
$(".cj").html(data.data[2].number);
$(".dj").html(data.data[3].number);
$(".ej").html(data.data[4].number);
let list = []