|
@@ -17,6 +17,20 @@ $(document).ready(function() {
|
|
|
//试验次数
|
|
|
function chart1(data) {
|
|
|
let myChart = echarts.init(document.getElementById('chart1'));
|
|
|
+ let xAxis=[];
|
|
|
+ let series_data=[];
|
|
|
+ data.forEach(item=>{
|
|
|
+ if(item.X.length==4){
|
|
|
+ xAxis.push(item.X+'年');
|
|
|
+ }
|
|
|
+ if(item.X.length==2){
|
|
|
+ xAxis.push(item.X+'月');
|
|
|
+ }
|
|
|
+ if(item.X.length==1){
|
|
|
+ xAxis.push(item.X+'季度');
|
|
|
+ }
|
|
|
+ series_data.push(item.C);
|
|
|
+ })
|
|
|
let option = {
|
|
|
tooltip: {
|
|
|
trigger: 'axis',
|
|
@@ -32,14 +46,13 @@ function chart1(data) {
|
|
|
containLabel: true
|
|
|
},
|
|
|
color: ['#23abca'],
|
|
|
- xAxis: [{
|
|
|
- data: ['2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022'],
|
|
|
- axisLine: options().yAxis.axisLine
|
|
|
+ xAxis: [{data: xAxis,
|
|
|
+ axisLine: chart_option().yAxis.axisLine
|
|
|
}],
|
|
|
- yAxis: options().yAxis,
|
|
|
+ yAxis: chart_option().yAxis,
|
|
|
series: [{
|
|
|
type: 'bar',
|
|
|
- data: [1235, 2300, 1221, 3420, 2321, 1036, 2567, 1700],
|
|
|
+ data: series_data,
|
|
|
barWidth: '35%', //柱子宽度
|
|
|
itemStyle: {
|
|
|
normal: {
|
|
@@ -66,6 +79,10 @@ function chart1(data) {
|
|
|
//渠道占比
|
|
|
function chart2(data) {
|
|
|
let myChart = echarts.init(document.getElementById('chart2'));
|
|
|
+ let list=[];
|
|
|
+ data.forEach(item=>{
|
|
|
+ list.push({value:item.COUNT,name:item.TAG});
|
|
|
+ });
|
|
|
let option = {
|
|
|
tooltip: {
|
|
|
trigger: 'axis',
|
|
@@ -86,13 +103,7 @@ function chart2(data) {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- data: [{
|
|
|
- value: 1048,
|
|
|
- name: '已完成'
|
|
|
- }, {
|
|
|
- value: 735,
|
|
|
- name: '未完成'
|
|
|
- }]
|
|
|
+ data:list
|
|
|
}
|
|
|
|
|
|
]
|
|
@@ -123,59 +134,9 @@ function chart3(data) {
|
|
|
color: ['#23abca'],
|
|
|
xAxis: [{
|
|
|
data: ['2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022'],
|
|
|
- axisLine: options().yAxis.axisLine
|
|
|
- }],
|
|
|
- yAxis: options().yAxis,
|
|
|
- series: [{
|
|
|
- type: 'bar',
|
|
|
- data: [1235, 2300, 1221, 3420, 2321, 1036, 2567, 1700],
|
|
|
- barWidth: '35%', //柱子宽度
|
|
|
- itemStyle: {
|
|
|
- normal: {
|
|
|
- opacity: 1,
|
|
|
- barBorderRadius: [5, 5, 0, 0],
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
- position: 'top',
|
|
|
- textStyle: {
|
|
|
- color: 'rgba(255,255,255,.6)'
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- ]
|
|
|
- };
|
|
|
- myChart.setOption(option);
|
|
|
- window.addEventListener("resize", function() {
|
|
|
- myChart.resize();
|
|
|
- });
|
|
|
-}
|
|
|
-//样机改装信息
|
|
|
-function chart4(data) {
|
|
|
- let myChart = echarts.init(document.getElementById('chart4'));
|
|
|
- data = [35, 23, 21, 23, 21, 36, 7, 17, 9];
|
|
|
- let option = {
|
|
|
- tooltip: {
|
|
|
- trigger: 'axis',
|
|
|
- axisPointer: {
|
|
|
- type: "shadow"
|
|
|
- }
|
|
|
- },
|
|
|
- grid: {
|
|
|
- left: '5%',
|
|
|
- top: '20%',
|
|
|
- right: '5%',
|
|
|
- bottom: '3%',
|
|
|
- containLabel: true
|
|
|
- },
|
|
|
- color: ['#23abca'],
|
|
|
- xAxis: [{
|
|
|
- data: ['2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022'],
|
|
|
- axisLine: options().yAxis.axisLine
|
|
|
+ axisLine: chart_option().yAxis.axisLine
|
|
|
}],
|
|
|
- yAxis: options().yAxis,
|
|
|
+ yAxis: chart_option().yAxis,
|
|
|
series: [{
|
|
|
type: 'bar',
|
|
|
data: [1235, 2300, 1221, 3420, 2321, 1036, 2567, 1700],
|
|
@@ -223,9 +184,9 @@ function chart5(data) {
|
|
|
color: ['#23abca'],
|
|
|
xAxis: [{
|
|
|
data: ['2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022'],
|
|
|
- axisLine: options().yAxis.axisLine
|
|
|
+ axisLine: chart_option().yAxis.axisLine
|
|
|
}],
|
|
|
- yAxis: options().yAxis,
|
|
|
+ yAxis: chart_option().yAxis,
|
|
|
series: [{
|
|
|
type: 'bar',
|
|
|
data: [1235, 2300, 1221, 3420, 2321, 1036, 2567, 1700],
|
|
@@ -273,9 +234,9 @@ function chart6(data) {
|
|
|
color: ['#23abca'],
|
|
|
xAxis: [{
|
|
|
data: ['2015', '2016', '2017', '2018', '2019', '2020', '2021', '2022'],
|
|
|
- axisLine: options().yAxis.axisLine
|
|
|
+ axisLine: chart_option().yAxis.axisLine
|
|
|
}],
|
|
|
- yAxis: options().yAxis,
|
|
|
+ yAxis: chart_option().yAxis,
|
|
|
series: [{
|
|
|
type: 'bar',
|
|
|
data: [1235, 2300, 1221, 3420, 2321, 1036, 2567, 1700],
|
|
@@ -303,36 +264,52 @@ function chart6(data) {
|
|
|
});
|
|
|
}
|
|
|
//向上滚动
|
|
|
-function roll(t) {
|
|
|
- //滚动排行1
|
|
|
+function roll(t,tag) {
|
|
|
+ //待完成试验滚动
|
|
|
let ul1 = document.getElementById("comment1");
|
|
|
let ul2 = document.getElementById("comment2");
|
|
|
let ulbox = document.getElementById("marquee-view");
|
|
|
ul2.innerHTML = ul1.innerHTML;
|
|
|
ulbox.scrollTop = 0; // 开始无滚动时设为0
|
|
|
- let timer = setInterval(rollStart, t, 1); // 设置定时器,参数t用在这为间隔时间(单位毫秒),参数t越小,滚动速度越快
|
|
|
+ let timer = setInterval(rollStart, t, tag); // 设置定时器,参数t用在这为间隔时间(单位毫秒),参数t越小,滚动速度越快
|
|
|
// 鼠标移入div时暂停滚动
|
|
|
ulbox.onmouseover = function() {
|
|
|
clearInterval(timer);
|
|
|
}
|
|
|
// 鼠标移出div后继续滚动
|
|
|
ulbox.onmouseout = function() {
|
|
|
- timer = setInterval(rollStart, t, 1);
|
|
|
+ timer = setInterval(rollStart, t, tag);
|
|
|
}
|
|
|
- //滚动排行2
|
|
|
+ //已完成试验滚动
|
|
|
var a2_ul1 = document.getElementById("a2_comment1");
|
|
|
var a2_ul2 = document.getElementById("a2_comment2");
|
|
|
var a2_ulbox = document.getElementById("a2_marquee-view");
|
|
|
a2_ul2.innerHTML = a2_ul1.innerHTML;
|
|
|
a2_ulbox.scrollTop = 0; // 开始无滚动时设为0
|
|
|
- var timer2 = setInterval(rollStart, t, 2); // 设置定时器,参数t用在这为间隔时间(单位毫秒),参数t越小,滚动速度越快
|
|
|
+ var timer2 = setInterval(rollStart, t, tag); // 设置定时器,参数t用在这为间隔时间(单位毫秒),参数t越小,滚动速度越快
|
|
|
// 鼠标移入div时暂停滚动
|
|
|
a2_ulbox.onmouseover = function() {
|
|
|
clearInterval(timer2);
|
|
|
}
|
|
|
// 鼠标移出div后继续滚动
|
|
|
a2_ulbox.onmouseout = function() {
|
|
|
- timer2 = setInterval(rollStart, t, 2);
|
|
|
+ timer2 = setInterval(rollStart, t, tag);
|
|
|
+ }
|
|
|
+
|
|
|
+ //样机改装信息滚动
|
|
|
+ var a3_ul1 = document.getElementById("a3_comment1");
|
|
|
+ var a3_ul2 = document.getElementById("a3_comment2");
|
|
|
+ var a3_ulbox = document.getElementById("a3_marquee-view");
|
|
|
+ a3_ul2.innerHTML = a3_ul1.innerHTML;
|
|
|
+ a3_ulbox.scrollTop = 0; // 开始无滚动时设为0
|
|
|
+ var timer3 = setInterval(rollStart, t, tag); // 设置定时器,参数t用在这为间隔时间(单位毫秒),参数t越小,滚动速度越快
|
|
|
+ // 鼠标移入div时暂停滚动
|
|
|
+ a3_ulbox.onmouseover = function() {
|
|
|
+ clearInterval(timer3);
|
|
|
+ }
|
|
|
+ // 鼠标移出div后继续滚动
|
|
|
+ a3_ulbox.onmouseout = function() {
|
|
|
+ timer3 = setInterval(rollStart, t, tag);
|
|
|
}
|
|
|
}
|
|
|
// 开始滚动函数
|
|
@@ -340,7 +317,6 @@ function rollStart(index) {
|
|
|
if (index == 1) {
|
|
|
// 上面声明的DOM对象为局部对象需要再次声明
|
|
|
let ul1 = document.getElementById("comment1");
|
|
|
- let ul2 = document.getElementById("comment2");
|
|
|
let ulbox = document.getElementById("marquee-view");
|
|
|
// 正常滚动不断给scrollTop的值+1,当滚动高度大于列表内容高度时恢复为0
|
|
|
if (ulbox.scrollTop >= ul1.scrollHeight) {
|
|
@@ -351,7 +327,6 @@ function rollStart(index) {
|
|
|
}
|
|
|
if (index == 2) {
|
|
|
let a2_ul1 = document.getElementById("a2_comment1");
|
|
|
- let a2_ul2 = document.getElementById("a2_comment2");
|
|
|
let a2_ulbox = document.getElementById("a2_marquee-view");
|
|
|
// 正常滚动不断给scrollTop的值+1,当滚动高度大于列表内容高度时恢复为0
|
|
|
if (a2_ulbox.scrollTop >= a2_ul1.scrollHeight) {
|
|
@@ -360,4 +335,14 @@ function rollStart(index) {
|
|
|
a2_ulbox.scrollTop++;
|
|
|
}
|
|
|
}
|
|
|
+ if (index == 3) {
|
|
|
+ let a3_ul1 = document.getElementById("a3_comment1");
|
|
|
+ let a3_ulbox = document.getElementById("a3_marquee-view");
|
|
|
+ // 正常滚动不断给scrollTop的值+1,当滚动高度大于列表内容高度时恢复为0
|
|
|
+ if (a3_ulbox.scrollTop >= a3_ul1.scrollHeight) {
|
|
|
+ a3_ulbox.scrollTop = 0;
|
|
|
+ } else {
|
|
|
+ a3_ulbox.scrollTop++;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|