|
|
|
|
@ -946,19 +946,17 @@ const barChartAndLineChartFour = function (data, id) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 折线图
|
|
|
|
|
const lineChart = function (data, id, unit = '',smooth=false) {
|
|
|
|
|
const lineChart = function (data, id, unit = '',smooth=false,color='#14bd2d') {
|
|
|
|
|
let charts = echarts.init(id);
|
|
|
|
|
if (!data) {
|
|
|
|
|
data = {
|
|
|
|
|
xName: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
|
|
|
|
|
yData: [61, 25, 57, 83, 87, 73, 17, 25, 57, 83, 87, 73],
|
|
|
|
|
yDataName: "提升百分比",
|
|
|
|
|
yDataTwo: [60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60],
|
|
|
|
|
yDataTwoName: "百分比"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let min = Math.ceil(Math.min(...data.yData,...(data.yDataTwo || [])))
|
|
|
|
|
let max = Math.ceil(Math.max(...data.yData,...(data.yDataTwo || [])))
|
|
|
|
|
let min = Math.ceil(Math.min(...data.yData))
|
|
|
|
|
let max = Math.ceil(Math.max(...data.yData))
|
|
|
|
|
let option = {
|
|
|
|
|
grid: {
|
|
|
|
|
top: '28%',
|
|
|
|
|
@ -1050,12 +1048,12 @@ const lineChart = function (data, id, unit = '',smooth=false) {
|
|
|
|
|
symbolSize: 4, //标记的大小
|
|
|
|
|
itemStyle: {
|
|
|
|
|
//折线拐点标志的样式
|
|
|
|
|
color: '#14bd2d',
|
|
|
|
|
color: color,
|
|
|
|
|
borderWidth: '2',
|
|
|
|
|
borderColor: '#14bd2d',
|
|
|
|
|
borderColor: color,
|
|
|
|
|
},
|
|
|
|
|
lineStyle: {
|
|
|
|
|
color: '#14bd2d',
|
|
|
|
|
color: color,
|
|
|
|
|
},
|
|
|
|
|
label: {
|
|
|
|
|
//图形上的文本标签
|
|
|
|
|
@ -1064,7 +1062,7 @@ const lineChart = function (data, id, unit = '',smooth=false) {
|
|
|
|
|
show: true,
|
|
|
|
|
position: "top",
|
|
|
|
|
textStyle: {
|
|
|
|
|
color: "#14bd2d",
|
|
|
|
|
color: color,
|
|
|
|
|
fontStyle: "normal",
|
|
|
|
|
fontFamily: "微软雅黑",
|
|
|
|
|
fontSize: 0.5 * vw,
|
|
|
|
|
@ -1073,58 +1071,6 @@ const lineChart = function (data, id, unit = '',smooth=false) {
|
|
|
|
|
},
|
|
|
|
|
data: data.yData,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: data.yDataTwoName,
|
|
|
|
|
type: 'line',
|
|
|
|
|
smooth:smooth,
|
|
|
|
|
showAllSymbol: true, //显示所有图形。
|
|
|
|
|
symbol: 'circle', //标记的图形为实心圆
|
|
|
|
|
symbolSize: 4, //标记的大小
|
|
|
|
|
itemStyle: {
|
|
|
|
|
//折线拐点标志的样式
|
|
|
|
|
color: '#3094ea',
|
|
|
|
|
borderWidth: '2',
|
|
|
|
|
borderColor: '#3094ea',
|
|
|
|
|
},
|
|
|
|
|
lineStyle: {
|
|
|
|
|
color: '#3094ea',
|
|
|
|
|
},
|
|
|
|
|
label: {
|
|
|
|
|
//图形上的文本标签
|
|
|
|
|
normal: {
|
|
|
|
|
formatter: `{c}${unit}`,
|
|
|
|
|
show: true,
|
|
|
|
|
position: "top",
|
|
|
|
|
textStyle: {
|
|
|
|
|
color: "#3094ea",
|
|
|
|
|
fontStyle: "normal",
|
|
|
|
|
fontFamily: "微软雅黑",
|
|
|
|
|
fontSize: 0.5 * vw,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
// areaStyle: {
|
|
|
|
|
// normal: {
|
|
|
|
|
// color: new echarts.graphic.LinearGradient(
|
|
|
|
|
// 0,
|
|
|
|
|
// 0,
|
|
|
|
|
// 0,
|
|
|
|
|
// 1,
|
|
|
|
|
// [
|
|
|
|
|
// {
|
|
|
|
|
// offset: 0,
|
|
|
|
|
// color: "rgb(76,82,193,0.7)",
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// offset: 0.8,
|
|
|
|
|
// color: "rgb(191,194,220,0.4)",
|
|
|
|
|
// },
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
data: data.yDataTwo,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|