Commit a35ca813 authored by xinzhedeai's avatar xinzhedeai

总收入排行

parent 011fd781
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<h4>孵化总收入排行榜</h4> <h4>孵化总收入排行榜</h4>
</div> </div>
<div class="ct-box"> <div class="ct-box">
<div class="wrap srphWrapper"></div> <div class="wrap srphWrapper" id="srphWrapper"></div>
</div> </div>
</div> </div>
</div> </div>
...@@ -99,8 +99,10 @@ import { reqApi } from "@/assets/js/httpApi.js"; ...@@ -99,8 +99,10 @@ import { reqApi } from "@/assets/js/httpApi.js";
import { Highchart } from "@/assets/js/chartTemplates.js"; import { Highchart } from "@/assets/js/chartTemplates.js";
import cuAmap from "@/components/AMap"; import cuAmap from "@/components/AMap";
import request from "@/utils/request"; import request from "@/utils/request";
import Highcharts from 'highcharts';
//关闭信息窗体 //关闭信息窗体
function closeInfoWindow(mapEle) { function closeInfoWindow(mapEle) {
mapEle.clearInfoWindow(); mapEle.clearInfoWindow();
} }
...@@ -231,7 +233,7 @@ export default { ...@@ -231,7 +233,7 @@ export default {
}, },
sjzl() { sjzl() {
// 数据总览 // 孵化数据总览
request({ request({
url: "api/homePage/incubatorOverview?size=9", url: "api/homePage/incubatorOverview?size=9",
method: "get", method: "get",
...@@ -240,12 +242,12 @@ export default { ...@@ -240,12 +242,12 @@ export default {
}); });
}, },
srph() { srph() {
// 收入排行f // 孵化总收入排行榜
request({ request({
url: "api/homePage/incubatorLeaderboard", url: "api/homePage/incubatorLeaderboard",
method: "get", method: "get",
}).then((res) => { }).then((res) => {
const list = res.body || []; const list = res.body.slice(0, 7) || [];
var colors = ["#ff8371", "#08b2c0", "#427fff", "#8dbffa", "#b2e2fe"]; var colors = ["#ff8371", "#08b2c0", "#427fff", "#8dbffa", "#b2e2fe"];
var chartData = Highchart.formatSeriesList(list, { var chartData = Highchart.formatSeriesList(list, {
value: "value", value: "value",
...@@ -255,18 +257,54 @@ export default { ...@@ -255,18 +257,54 @@ export default {
chartConfig: { chartConfig: {
chart: { chart: {
type: "bar", type: "bar",
marginBottom: 10, // marginBottom: 10,
bottom:10,
left:40,
}, },
xAxis: { xAxis: {
type: "category", type: "category",
lineWidth: 1, lineWidth: 1,
labels: { labels: {
x: -5, x: -5,
style: {
fontSize: "0.17rem",
},
formatter: function() {
return this.value.length > 5 ? this.value.substring(0, 5) + '...' : this.value;
}
}, },
}, },
yAxis: { yAxis: {
min: 0,
visible: false, visible: false,
title: {
style: {
color: "#eee",
fontSize: "0.18rem",
},
},
labels: {
overflow: 'justify',
// style: {
// fontSize: '20px' // 设置 Y 轴标签的字体大小
// }
}
}, },
plotOptions: {
bar: {
dataLabels: {
enabled: true,
allowOverlap: true, // 允许数据标签重叠
style: {
fontSize: '0.19rem', // 设置数据标签的字体大小
fontWeight: 'bold' // 设置数据标签的字体粗细
}
}
}
},
tooltip: {
pointFormat: "<b style='fontSize:24rem;'>{series.name}:</b> <b style='fontSize:24rem;'>{point.y:.1f}%</b>",
},
series: [ series: [
{ {
name: "", name: "",
...@@ -288,6 +326,57 @@ export default { ...@@ -288,6 +326,57 @@ export default {
opts opts
); );
}); });
// var chart = Highcharts.chart('srphWrapper', {
// isSeriesData: true,
// chart: {
// type: 'bar'
// },
// xAxis: {
// categories: ['非洲', '美洲', '亚洲', '欧洲', '大洋洲'],
// title: {
// text: null,
// },
// labels: {
// x: -5,
// style: {
// fontSize: "20px",
// },
// },
// },
// yAxis: {
// min: 0,
// title: {
// text: '(万)',
// },
// labels: {
// overflow: 'justify',
// style: {
// fontSize: "20px",
// },
// }
// },
// tooltip: {
// valueSuffix: ' 百万'
// },
// plotOptions: {
// bar: {
// dataLabels: {
// enabled: true,
// allowOverlap: true, // 允许数据标签重叠
// style: {
// fontSize: '20px', // 设置数据标签的字体大小
// fontWeight: 'bold' // 设置数据标签的字体粗细
// }
// }
// }
// },
// series: [{
// name: '',
// data: [107, 31, 635, 203, 2]
// }]
// });
}, },
qycxcysjfx() { qycxcysjfx() {
//企业创新创业数据分析 //企业创新创业数据分析
...@@ -1139,17 +1228,11 @@ export default { ...@@ -1139,17 +1228,11 @@ export default {
<style lang="scss" scope> <style lang="scss" scope>
.amap-icon{ // 高德地图样式覆盖 .amap-icon{ // 高德地图样式覆盖
img{ img{
width:0.42rem !important; width:0.52rem !important;
height: 0.42rem !important; height: 0.52rem !important;
} }
} }
.textEllipsis {
display: inline-block;
white-space: nowrap; /* 不换行 */
overflow: hidden; /* 超出隐藏 */
text-overflow: ellipsis; /* 添加省略号 */
width: 320px; /* 设置宽度 */
}
#container { #container {
height: 100%; height: 100%;
width: 100%; width: 100%;
...@@ -1920,6 +2003,13 @@ export default { ...@@ -1920,6 +2003,13 @@ export default {
background-position: center center; background-position: center center;
background-size: 100% 100%; background-size: 100% 100%;
position: relative; position: relative;
.textEllipsis {
display: inline-block;
white-space: nowrap; /* 不换行 */
overflow: hidden; /* 超出隐藏 */
text-overflow: ellipsis; /* 添加省略号 */
width: 320px; /* 设置宽度 */
}
button { button {
width: 1.5rem; width: 1.5rem;
height: 0.4rem; height: 0.4rem;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment