Commit f94c4c3f authored by xinzhedeai's avatar xinzhedeai

dp地址

parent cd6c01a7
...@@ -108,26 +108,26 @@ import cuAmap from "@/components/AMap"; ...@@ -108,26 +108,26 @@ import cuAmap from "@/components/AMap";
import request from "@/utils/request"; import request from "@/utils/request";
// let resizeTimeout; let resizeTimeout;
// window.addEventListener('resize', function() { window.addEventListener('resize', function() {
// clearTimeout(resizeTimeout); clearTimeout(resizeTimeout);
// resizeTimeout = setTimeout(function() { resizeTimeout = setTimeout(function() {
// location.reload(); location.reload();
// // 执行响应逻辑 // 执行响应逻辑
// }, 200); // 200毫秒后执行 }, 200); // 200毫秒后执行
// }); });
// function getPxByRem(remValue){// 传入要转换的 rem 值 function getPxByRem(remValue){// 传入要转换的 rem 值
// // 获取 html 元素 // 获取 html 元素
// const htmlElement = document.documentElement; const htmlElement = document.documentElement;
// // 获取 html 元素的 font-size // 获取 html 元素的 font-size
// const fontSize = parseFloat(getComputedStyle(htmlElement).fontSize); const fontSize = parseFloat(getComputedStyle(htmlElement).fontSize);
// // 将 rem 转换为 px // 将 rem 转换为 px
// let pxValue = remValue * fontSize; let pxValue = remValue * fontSize;
// return pxValue return pxValue
// } }
export default { export default {
...@@ -294,11 +294,12 @@ export default { ...@@ -294,11 +294,12 @@ export default {
chartConfig: { chartConfig: {
chart: { chart: {
type: "bar", type: "bar",
marginTop: 20, marginTop: getPxByRem(0.15),
// marginBottom: 10, // marginBottom: 10,
// bottom:10, // bottom:10,
// left:40, // left:40,
marginRight: 30, marginBottom: getPxByRem(0.45),
marginRight: getPxByRem(0.3),
}, },
xAxis: { xAxis: {
type: "category", type: "category",
...@@ -749,82 +750,6 @@ export default { ...@@ -749,82 +750,6 @@ export default {
method: "get", method: "get",
}).then((res) => { }).then((res) => {
let list = res.body || []; let list = res.body || [];
list = {
names: [
{
name: "上缴税费",
key: "num",
},
],
list: [
{
date: "2021年",
values: {
num: 100,
},
},
{
date: "2023年",
values: {
num: 41,
},
},
{
date: "2024年",
values: {
num: 533,
},
},
{
date: "2025年",
values: {
num: 303,
},
},
{
date: "2026年",
values: {
num: 306,
},
},
{
date: "2027年",
values: {
num: 309,
},
},
{
date: "2028年",
values: {
num: 312,
},
},
{
date: "2029年",
values: {
num: 315,
},
},
{
date: "2030年",
values: {
num: 318,
},
},
{
date: "2031年",
values: {
num: 321,
},
},
{
date: "2032年",
values: {
num: 324,
},
},
],
};
var chartData = Highchart.seriesDataFormat(list, { var chartData = Highchart.seriesDataFormat(list, {
datekey: "date", datekey: "date",
dataReverse: true, dataReverse: true,
...@@ -834,10 +759,10 @@ export default { ...@@ -834,10 +759,10 @@ export default {
var opts = { var opts = {
chartConfig: { chartConfig: {
chart: { chart: {
marginTop: 40, marginTop: getPxByRem(0.4),
marginLeft: 50, marginLeft: getPxByRem(0.5),// 50,
marginBottom: 45, marginBottom: getPxByRem(0.45),
marginRight: 20, marginRight: getPxByRem(0.2),
}, },
xAxis: { xAxis: {
lineWidth: 1, // 设置 Y 轴坐标轴线宽度 lineWidth: 1, // 设置 Y 轴坐标轴线宽度
...@@ -858,7 +783,7 @@ export default { ...@@ -858,7 +783,7 @@ export default {
// tickLength: 0, // 不显示刻度线 // tickLength: 0, // 不显示刻度线
gridLineWidth: 0, // 也可以设置不显示网格线 gridLineWidth: 0, // 也可以设置不显示网格线
title: { title: {
text: "(万元)", text: "万元",
margin: 0, margin: 0,
style: { style: {
color: "#eee", color: "#eee",
...@@ -866,8 +791,8 @@ export default { ...@@ -866,8 +791,8 @@ export default {
}, },
rotation: 0, rotation: 0,
align: "high", align: "high",
y: -15, y: getPxByRem(-0.15),
x: 45, x: getPxByRem(0.4),
}, },
labels: { labels: {
style: { style: {
......
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