Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Z
zh_zcb-ems
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chen.yiwen
zh_zcb-ems
Commits
b1030caf
Commit
b1030caf
authored
Mar 06, 2023
by
huangzihao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up
parent
a9a6516d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
index.js
src/js/index.js
+5
-5
No files found.
src/js/index.js
View file @
b1030caf
...
@@ -245,11 +245,11 @@ const lineChartOption = (xData, yData, interval) => {
...
@@ -245,11 +245,11 @@ const lineChartOption = (xData, yData, interval) => {
/**
/**
* echartjs 饼图通用配置
* echartjs 饼图通用配置
*/
*/
const
pieChartOption
=
(
data
,
isPercent
)
=>
{
const
pieChartOption
=
(
data
,
isPercent
,
unit
)
=>
{
return
{
return
{
tooltip
:
{
tooltip
:
{
trigger
:
"item"
,
trigger
:
"item"
,
formatter
:
isPercent
?
"{b}: {c}"
:
"{b}: {d}%"
,
formatter
:
isPercent
?
"{b}: {c}"
+
unit
:
"{b}: {d}%"
,
},
},
series
:
[
series
:
[
{
{
...
@@ -268,7 +268,7 @@ const pieChartOption = (data, isPercent) => {
...
@@ -268,7 +268,7 @@ const pieChartOption = (data, isPercent) => {
if
(
isPercent
)
{
if
(
isPercent
)
{
return
param
.
name
+
": "
+
param
.
percent
+
"%"
;
return
param
.
name
+
": "
+
param
.
percent
+
"%"
;
}
else
{
}
else
{
return
param
.
name
+
": "
+
param
.
value
;
return
param
.
name
+
": "
+
param
.
value
+
unit
;
}
}
},
},
},
},
...
@@ -505,12 +505,12 @@ const leftLineChart = () => {
...
@@ -505,12 +505,12 @@ const leftLineChart = () => {
);
);
const
pieChart3
=
echarts
.
init
(
document
.
getElementById
(
"pie_chart_3"
));
const
pieChart3
=
echarts
.
init
(
document
.
getElementById
(
"pie_chart_3"
));
pieChart3
.
setOption
(
pieChartOption
(
echart3Data
,
true
));
pieChart3
.
setOption
(
pieChartOption
(
echart3Data
,
true
,
" kW"
));
};
};
const
rightLineChart
=
()
=>
{
const
rightLineChart
=
()
=>
{
const
pieChart4
=
echarts
.
init
(
document
.
getElementById
(
"pie_chart_4"
));
const
pieChart4
=
echarts
.
init
(
document
.
getElementById
(
"pie_chart_4"
));
pieChart4
.
setOption
(
pieChartOption
(
echart4Data
));
pieChart4
.
setOption
(
pieChartOption
(
echart4Data
,
false
,
" kW"
));
const
lineChart5
=
echarts
.
init
(
document
.
getElementById
(
"line_chart_5"
));
const
lineChart5
=
echarts
.
init
(
document
.
getElementById
(
"line_chart_5"
));
lineChart5
.
setOption
(
lineChart5
.
setOption
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment