1
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
<link rel="icon" href="/favicon.ico" />
|
<link rel="icon" href="/favicon.ico" />
|
||||||
<script src="/node_modules/ace-builds/src-min-noconflict/ace.js" type="text/javascript"></script>
|
<script src="/node_modules/ace-builds/src-min-noconflict/ace.js" type="text/javascript"></script>
|
||||||
<title>NPCs</title>
|
<title>NPCs</title>
|
||||||
<script type="module" crossorigin src="/assets/index-583c10b3.js"></script>
|
<script type="module" crossorigin src="/assets/index-45eec280.js"></script>
|
||||||
<link rel="modulepreload" crossorigin href="/assets/acebuilds-fbc0ccc6.js">
|
<link rel="modulepreload" crossorigin href="/assets/acebuilds-fbc0ccc6.js">
|
||||||
<link rel="modulepreload" crossorigin href="/assets/reactflow-c250d835.js">
|
<link rel="modulepreload" crossorigin href="/assets/reactflow-c250d835.js">
|
||||||
<link rel="modulepreload" crossorigin href="/assets/reactdrop-be699031.js">
|
<link rel="modulepreload" crossorigin href="/assets/reactdrop-be699031.js">
|
||||||
|
|||||||
@@ -179,6 +179,7 @@
|
|||||||
"machineName": "服务名",
|
"machineName": "服务名",
|
||||||
"addOne": "加一条"
|
"addOne": "加一条"
|
||||||
},
|
},
|
||||||
|
|
||||||
"flow": {
|
"flow": {
|
||||||
"unsavedChangesConfirmation": "您有未保存的更改,确定要离开吗?",
|
"unsavedChangesConfirmation": "您有未保存的更改,确定要离开吗?",
|
||||||
"leave": "离开",
|
"leave": "离开",
|
||||||
|
|||||||
@@ -6,25 +6,84 @@ function Chart({ options }) {
|
|||||||
let chartInstance = null;
|
let chartInstance = null;
|
||||||
|
|
||||||
options = eval('('+options.substring(8)+')');
|
options = eval('('+options.substring(8)+')');
|
||||||
console.log(options)
|
options = {
|
||||||
|
"chartType": "line",
|
||||||
|
"xData": [
|
||||||
|
"江苏",
|
||||||
|
"浙江",
|
||||||
|
"广东",
|
||||||
|
"广州",
|
||||||
|
"北京",
|
||||||
|
"山西",
|
||||||
|
"河北"
|
||||||
|
],
|
||||||
|
"data": {
|
||||||
|
"2023上半年":['120%', '132%', '101%', '134%', '90%', '230%', '210%'],
|
||||||
|
"2024上半年":['220%', '182%', '191%', '234%', '290%', '330%', '310%']
|
||||||
|
},
|
||||||
|
"legend": [],
|
||||||
|
"pieData": []
|
||||||
|
}
|
||||||
|
options.legend = Object.keys(options.data);
|
||||||
|
options.pieData = [];
|
||||||
|
options.series = [];
|
||||||
|
|
||||||
const options1 = {
|
options.xData.map((data,index) =>{
|
||||||
|
options.pieData.push({'name':data,'value':options.data[options.legend[0]][index].split("%").join("")})
|
||||||
|
})
|
||||||
|
options.legend.map((data,index) =>{
|
||||||
|
let list = [];
|
||||||
|
options.data[data].map(data1 =>{
|
||||||
|
list.push(data1.split("%").join(""))
|
||||||
|
});
|
||||||
|
options.series.push({
|
||||||
|
name: data,
|
||||||
|
type: options.chartType,
|
||||||
|
data: list,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
console.log(options)
|
||||||
|
let options1;
|
||||||
|
if(options.chartType == "pie"){
|
||||||
|
options1 = {
|
||||||
tooltip: {},
|
tooltip: {},
|
||||||
legend: {
|
|
||||||
data: [""],
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
data: options.data.map(obj => {return obj.name}),
|
|
||||||
},
|
|
||||||
yAxis: {},
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "",
|
name: 'Access From',
|
||||||
type: options.chartType,
|
type: 'pie',
|
||||||
data: options.data.map(obj => {return obj.value}),
|
radius: '50%',
|
||||||
|
label: {
|
||||||
|
normal: {
|
||||||
|
|
||||||
|
textStyle: { // 提示文字的样式
|
||||||
|
color: '#fff',
|
||||||
|
fontSize: 14
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
],
|
data: options.pieData,
|
||||||
};
|
emphasis: {
|
||||||
|
itemStyle: {
|
||||||
|
shadowBlur: 10,
|
||||||
|
shadowOffsetX: 0,
|
||||||
|
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}else{
|
||||||
|
options1 = {
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis'
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
data: options.xData,
|
||||||
|
},
|
||||||
|
yAxis: {},
|
||||||
|
series: options.series,
|
||||||
|
};
|
||||||
|
}
|
||||||
// 定义渲染函数
|
// 定义渲染函数
|
||||||
function renderChart() {
|
function renderChart() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user