This commit is contained in:
2025-09-11 14:34:32 +08:00
parent 40a7a8fb7a
commit 5dfc68fd47
3 changed files with 108 additions and 35 deletions

View File

@@ -29,40 +29,22 @@ $(function () {
dataType: "json",
url: "/RuYuanZaiYuan/school/preschool/chart",
success: function (option) {
console.log(option);
option.grid = {
left: 0,
right: 0,
top: 30,
bottom: 0,
containLabel: true,
};
option.textStyle = {
color: "#fff",
};
option.tooltip = {
trigger: "axis",
axisPointer: {
type: "cross",
crossStyle: { color: "#999" },
},
textStyle: { color: "#fff" },
// 1. 背景色
backgroundColor: "rgba(96,98,102,0.8)", // 半透明黑
// 2. 边框
borderColor: "rgba(255,255,255,0.3)",
borderWidth: 1,
};
option.series.forEach((seriesItem, index) => {
option_1_1.series.forEach((seriesItem, index) => {
seriesItem.tooltip = { valueFormatter: (v) => v + " 万人" };
});
myChart.setOption(option);
option_1_1.xAxis[0].data = [
"2013",
"2016",
"2017",
"2018",
"2019",
"2020",
"2021",
"2022",
"2023",
"2024",
];
myChart.setOption(option_1_1);
window.addEventListener("resize", function () {
myChart.resize();
});