修改正负值显示

master
夜笙歌 3 years ago
parent 11d6d89ec9
commit 9333d1ac10

@ -264,7 +264,7 @@ body.FoamerScada {
body.Foamer2 {
height: auto;
width: auto;
background: url(../img/foamer2.jpg) no-repeat center fixed;
background: url(../img/foamer21.jpg) no-repeat center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

@ -946,7 +946,7 @@ const barChartAndLineChartFour = function (data, id) {
}
// 折线图
const lineChart = function (data, id, unit = '',smooth=false,color='#14bd2d') {
const lineChart = function (data, id, unit = '', smooth = false, color = '#14bd2d') {
let charts = echarts.init(id);
if (!data) {
data = {
@ -976,13 +976,13 @@ const lineChart = function (data, id, unit = '',smooth=false,color='#14bd2d') {
},
legend: {
top: '5%',
itemWidth:20,
itemHeight:10,
itemStyle:{
borderWidth:1,
borderHeight:1,
itemWidth: 20,
itemHeight: 10,
itemStyle: {
borderWidth: 1,
borderHeight: 1,
},
formatter:function (val) {
formatter: function (val) {
return `${val} `
},
textStyle: {
@ -1010,7 +1010,7 @@ const lineChart = function (data, id, unit = '',smooth=false,color='#14bd2d') {
},
yAxis: [
{
name:'合格率',
name: '合格率',
min: (min - 2 < 0) ? 0 : min - 2,
max: (max + 2 > 100) ? 100 : max + 2,
type: 'value',
@ -1031,7 +1031,7 @@ const lineChart = function (data, id, unit = '',smooth=false,color='#14bd2d') {
},
axisLabel: {
show: true,
interval:0,
interval: 0,
textStyle: {
color: '#ffffff',
},
@ -1042,7 +1042,7 @@ const lineChart = function (data, id, unit = '',smooth=false,color='#14bd2d') {
{
name: data.yDataName,
type: 'line',
smooth:smooth,
smooth: smooth,
showAllSymbol: true, //显示所有图形。
symbol: 'circle', //标记的图形为实心圆
symbolSize: 4, //标记的大小
@ -1079,7 +1079,7 @@ const lineChart = function (data, id, unit = '',smooth=false,color='#14bd2d') {
}
const lineChartTwo = function (data, id, unit = '') {
let charts = echarts.init(id);
let color = ['#3094ea','#2fd032','#6ba72c','#7b6931','#8909E5']
let color = ['#3094ea', '#2fd032', '#6ba72c', '#7b6931', '#8909E5']
if (!data) {
data = {
xName: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
@ -1098,7 +1098,7 @@ const lineChartTwo = function (data, id, unit = '') {
let num = data.yData.map(val => val.data).flat(Infinity)
let min = Math.ceil(Math.min(...num))
let max = Math.ceil(Math.max(...num))
let series = data.yData.map((val,index) => {
let series = data.yData.map((val, index) => {
return {
name: val.name,
type: 'line',
@ -1150,14 +1150,15 @@ const lineChartTwo = function (data, id, unit = '') {
},
legend: {
top: '5%',
itemWidth:20,
itemHeight:10,
formatter:function (val) {
itemWidth: 20,
itemHeight: 10,
formatter: function (val) {
return `${val}`
},
textStyle: {
fontSize: 0.75 * vw,
color: () => {},
color: () => {
},
},
},
xAxis: {
@ -1210,7 +1211,7 @@ const lineChartTwo = function (data, id, unit = '') {
charts.setOption(option);
$(window).resize(charts.resize);
}
const lineChartThree = function (data, id, unit = '',smooth=false) {
const lineChartThree = function (data, id, unit = '', smooth = false) {
let charts = echarts.init(id);
if (!data) {
data = {
@ -1221,8 +1222,8 @@ const lineChartThree = function (data, id, unit = '',smooth=false) {
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, ...(data.yDataTwo || [])))
let max = Math.ceil(Math.max(...data.yData, ...(data.yDataTwo || [])))
let option = {
grid: {
top: '28%',
@ -1242,13 +1243,13 @@ const lineChartThree = function (data, id, unit = '',smooth=false) {
},
legend: {
top: '5%',
itemWidth:20,
itemHeight:10,
itemStyle:{
borderWidth:1,
borderHeight:1,
itemWidth: 20,
itemHeight: 10,
itemStyle: {
borderWidth: 1,
borderHeight: 1,
},
formatter:function (val) {
formatter: function (val) {
return `${val} `
},
textStyle: {
@ -1276,7 +1277,7 @@ const lineChartThree = function (data, id, unit = '',smooth=false) {
},
yAxis: [
{
name:'(元/台)',
name: '(元/台)',
min: (min - 2 < 0) ? 0 : min - 2,
max: (max + 2 > 100) ? 100 : max + 2,
type: 'value',
@ -1297,7 +1298,7 @@ const lineChartThree = function (data, id, unit = '',smooth=false) {
},
axisLabel: {
show: true,
interval:0,
interval: 0,
textStyle: {
color: '#ffffff',
},
@ -1308,7 +1309,7 @@ const lineChartThree = function (data, id, unit = '',smooth=false) {
{
name: data.yDataName,
type: 'line',
smooth:smooth,
smooth: smooth,
showAllSymbol: true, //显示所有图形。
symbol: 'circle', //标记的图形为实心圆
symbolSize: 4, //标记的大小
@ -1340,7 +1341,7 @@ const lineChartThree = function (data, id, unit = '',smooth=false) {
{
name: data.yDataTwoName,
type: 'line',
smooth:smooth,
smooth: smooth,
showAllSymbol: true, //显示所有图形。
symbol: 'circle', //标记的图形为实心圆
symbolSize: 4, //标记的大小
@ -1528,11 +1529,11 @@ const pieChartTwo = function (data, id, unit = '次') {
// color: ["rgb(131,249,103)", "#FBFE27", "#FE5050", "#1DB7E5"], //'#FBFE27','rgb(11,228,96)','#FE5050'
data: data,
roseType: "radius",
overflow:'break',
overflow: 'break',
label: {
overflow:'break',
overflow: 'break',
normal: {
overflow:'break',
overflow: 'break',
formatter: `{b|{b}} \n {c|{c}${unit}}`,
rich: {
c: {
@ -1630,7 +1631,7 @@ const verticalBarChart = function (data, id, unit = '次') {
series: [
{
type: "bar",
barWidth: data.yData.length<4? 2*vw:'75%',
barWidth: data.yData.length < 4 ? 2 * vw : '75%',
label: {
show: true,
position: 'top',
@ -1674,6 +1675,36 @@ const verticalBarChart = function (data, id, unit = '次') {
// 多个垂直柱状图
const multipleVerticalBarChart1 = function (data, id) {
let charts = echarts.init(id);
let num1 = data.yDataOne.slice(0,4)
let num2 = data.yDataTwo.slice(0,4)
let num3 = data.yDataThree.slice(0,4)
num1 = num1.map(e => {
if (e > 14) {
return 14
} else if (e < 10) {
return 10
} else {
return e
}
})
num2 = num2.map(e => {
if (e > 14) {
return 14
} else if (e < 10) {
return 10
} else {
return e
}
})
num3 = num3.map(e => {
if (e > 14) {
return 14
} else if (e < 10) {
return 10
} else {
return e
}
})
if (!data) {
data = {
xName: [
@ -1703,20 +1734,6 @@ const multipleVerticalBarChart1 = function (data, id) {
},
},
},
// trigger: "axis",
// formatter: `{b}<br />{a0}: {c0}<br />{a1}: {c1}`,
// axisPointer: {
// type: "shadow",
// label: {
// backgroundColor: "#6a7985",
// },
// },
// textStyle: {
// color: "#fff",
// fontStyle: "normal",
// fontFamily: "微软雅黑",
// fontSize: 12,
// },
},
grid: {
left: "1%",
@ -1745,7 +1762,7 @@ const multipleVerticalBarChart1 = function (data, id) {
{
type: "category",
boundaryGap: true, //坐标轴两边留白
data: data.xName,
data: ['A1', 'A2', 'A3', 'A4'],
axisLabel: {
show: true,
color: '#fff'
@ -2193,7 +2210,7 @@ const multipleVerticalBarChart = function (data, id) {
charts.setOption(option);
$(window).resize(charts.resize);
}
const multipleVerticalBarChartTwo = function (data, id, rotate = 0, unit = '',margin=20,isColor=true) {
const multipleVerticalBarChartTwo = function (data, id, rotate = 0, unit = '', margin = 20, isColor = true) {
let charts = echarts.init(id);
if (!data) {
data = {
@ -2219,7 +2236,7 @@ const multipleVerticalBarChartTwo = function (data, id, rotate = 0, unit = '',ma
}
},
legend: {
right:'0',
right: '0',
data: [data.yDataOneName, data.yDataTwoName],
textStyle: {
fontSize: 0.75 * vw,
@ -2270,7 +2287,7 @@ const multipleVerticalBarChartTwo = function (data, id, rotate = 0, unit = '',ma
itemStyle: {
//图形样式
normal: {
color: isColor? '#db8151': "#64BCEC",
color: isColor ? '#db8151' : "#64BCEC",
},
},
label: {
@ -2305,7 +2322,7 @@ const multipleVerticalBarChartTwo = function (data, id, rotate = 0, unit = '',ma
itemStyle: {
//图形样式
normal: {
color: isColor? '#9ce375': "#4FD3B9",
color: isColor ? '#9ce375' : "#4FD3B9",
},
},
data: data.yDataTwo
@ -2935,7 +2952,7 @@ const multipleBrokenLineAreaDiagram1 = (data, ids) => {
dataZoom: [],
xAxis: [
{
show:false,
show: false,
type: "category",
boundaryGap: false,
axisLine: {

Loading…
Cancel
Save