|
|
|
@ -11,30 +11,7 @@ import { bigNumberTransform } from "@/utils/gol/dataTool"
|
|
|
|
|
import {doStr} from "@/utils/gol/dataTool"
|
|
|
|
|
let colors = ['#546fc5', '#91cb74', '#f9c857', '#ed6565', '#72bfde', '#3aa272', '#fb8351'];
|
|
|
|
|
let dataURI = 'path://M512 149.333333c200.298667 0 362.666667 162.368 362.666667 362.666667s-162.368 362.666667-362.666667 362.666667S149.333333 712.298667 149.333333 512 311.701333 149.333333 512 149.333333z m32 298.666667h-64v256h64V448z m0-106.666667h-64v64h64v-64z'
|
|
|
|
|
function createData(ds = []) {
|
|
|
|
|
//--设定标记的位置和颜色--//
|
|
|
|
|
let maxIndex = 0;
|
|
|
|
|
let maxVal = 0;
|
|
|
|
|
let vi = 0;
|
|
|
|
|
ds.forEach(ele => {
|
|
|
|
|
let columnMax = 0;
|
|
|
|
|
ele.forEach(e => {
|
|
|
|
|
if(e.value * 1.0 >= columnMax) {columnMax = e.value * 1.0}
|
|
|
|
|
})
|
|
|
|
|
if(columnMax >= maxVal) {maxVal = columnMax, maxIndex = vi};
|
|
|
|
|
vi += 1;
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
let colorArr = ds[maxIndex];
|
|
|
|
|
let mcIndex = 0;
|
|
|
|
|
let colorIndex = 0;
|
|
|
|
|
let colorMax = colorArr[0].value * 1;
|
|
|
|
|
colorArr.forEach(ele => {
|
|
|
|
|
if(ele.value * 1 >= colorMax) {colorMax = ele.value * 1, mcIndex = colorIndex};
|
|
|
|
|
colorIndex += 1;
|
|
|
|
|
});
|
|
|
|
|
let markColor = colors[mcIndex]
|
|
|
|
|
//--//
|
|
|
|
|
function createData(ds = [], hotIndex = []) {
|
|
|
|
|
let arr = [];
|
|
|
|
|
for (let i = 0; i < ds.length; i++) {
|
|
|
|
|
let arr1 = ds[i];
|
|
|
|
@ -64,16 +41,7 @@ function createData(ds = []) {
|
|
|
|
|
},
|
|
|
|
|
data: [arr1[j].value],
|
|
|
|
|
markPoint: {
|
|
|
|
|
data: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Max',
|
|
|
|
|
xAxis: maxIndex, yAxis: maxVal,
|
|
|
|
|
symbol: dataURI,
|
|
|
|
|
symbolSize: 24,
|
|
|
|
|
symbolOffset: [0, '-65%'],
|
|
|
|
|
itemStyle: {color: markColor},
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
data: [],
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
arr.push(obj)
|
|
|
|
@ -81,11 +49,33 @@ function createData(ds = []) {
|
|
|
|
|
arr[n].data.push(arr1[j].value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
hotIndex.forEach(e => {
|
|
|
|
|
let yMax = 0; //y轴
|
|
|
|
|
let colorMax = 0; //颜色的索引
|
|
|
|
|
for(let i = 0; i<arr.length; i++){
|
|
|
|
|
if(arr[i].data[e] * 1 > yMax){
|
|
|
|
|
yMax = arr[i].data[e];
|
|
|
|
|
colorMax = i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
arr.forEach(ele => {
|
|
|
|
|
ele.markPoint.data.push(
|
|
|
|
|
{
|
|
|
|
|
name: 'Max',
|
|
|
|
|
xAxis: e, yAxis: yMax,
|
|
|
|
|
symbol: dataURI,
|
|
|
|
|
symbolSize: 24,
|
|
|
|
|
symbolOffset: [0, '-65%'],
|
|
|
|
|
itemStyle: {color: colors[colorMax]},
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
return arr;
|
|
|
|
|
}
|
|
|
|
|
export default function createOpt(dx = [], ds = [], hotTopArr=[]) {
|
|
|
|
|
let data = createData(ds)
|
|
|
|
|
export default function createOpt(dx = [], ds = [], hotTopArr=[], hotIndex = []) {
|
|
|
|
|
let data = createData(ds, hotIndex)
|
|
|
|
|
return {
|
|
|
|
|
grid: {
|
|
|
|
|
left: '3%',
|
|
|
|
|