This commit is contained in:
2025-09-11 14:44:51 +08:00
parent cc11287e57
commit df5b4c531f
3 changed files with 8 additions and 16 deletions

View File

@@ -20,8 +20,7 @@ option_1_1 = {
xAxis: [ xAxis: [
{ {
type: "category", type: "category",
data: [ data: [],
],
axisPointer: { type: "shadow" }, axisPointer: { type: "shadow" },
axisLine: { lineStyle: { color: "#fff" } }, axisLine: { lineStyle: { color: "#fff" } },
axisLabel: { color: "#fff" }, axisLabel: { color: "#fff" },
@@ -36,28 +35,19 @@ option_1_1 = {
{ {
name: "城区", name: "城区",
type: "bar", type: "bar",
data: [ data: [],
74.7516, 73.3111, 74.7406, 76.2088, 71.4245, 83.2045, 71.4945, 66.099,
60.236, 50.1589,
],
itemStyle: { borderRadius: [6, 6, 0, 0] }, itemStyle: { borderRadius: [6, 6, 0, 0] },
}, },
{ {
name: "镇区", name: "镇区",
type: "bar", type: "bar",
data: [ data: [ ],
13.302, 13.9083, 15.4038, 16.3225, 16.3852, 19.2568, 17.8375, 17.4047,
16.0644, 13.5613,
],
itemStyle: { borderRadius: [6, 6, 0, 0] }, itemStyle: { borderRadius: [6, 6, 0, 0] },
}, },
{ {
name: "乡村", name: "乡村",
type: "bar", type: "bar",
data: [ data: [ ],
25.536, 24.6128, 24.8226, 25.2409, 22.1658, 26.4498, 23.5793, 22.1677,
20.5735, 17.7902,
],
itemStyle: { borderRadius: [6, 6, 0, 0] }, itemStyle: { borderRadius: [6, 6, 0, 0] },
}, },
{ {
@@ -65,8 +55,6 @@ option_1_1 = {
type: "line", type: "line",
yAxisIndex: 1, yAxisIndex: 1,
data: [ data: [
113.5896, 111.8322, 114.967, 117.7722, 109.9755, 128.9111, 112.9113,
105.6714, 96.8739, 81.5104,
], ],
}, },
{ {

View File

@@ -33,6 +33,10 @@ $(function () {
seriesItem.tooltip = { valueFormatter: (v) => v + " 万人" }; seriesItem.tooltip = { valueFormatter: (v) => v + " 万人" };
}); });
option_1_1.xAxis[0].data = res.xAxis_data; option_1_1.xAxis[0].data = res.xAxis_data;
option_1_1.series[0].data = res.series_data_1;
option_1_1.series[1].data = res.series_data_2;
option_1_1.series[2].data = res.series_data_3;
option_1_1.series[3].data = res.series_data_4;
myChart.setOption(option_1_1); myChart.setOption(option_1_1);
window.addEventListener("resize", function () { window.addEventListener("resize", function () {
myChart.resize(); myChart.resize();