-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Allen Zhang (张涛)
committed
Oct 25, 2024
1 parent
4d4be80
commit 9e1af5a
Showing
5 changed files
with
10,165 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,153 +1,15 @@ | ||
import EChartsReact from "echarts-for-react"; | ||
const data = { | ||
Month: ["1月", "2月", "3月", "4月", "5月", "6月"], | ||
// "Branch Coverage (%)": [66.08, 67.18, 64.81, 68.7, 71.82, 76.37], | ||
// "Line Coverage (%)": [56.08, 59.19, 63.23, 66.47, 71.61, 77.23], | ||
"Branch Coverage (%)": [50.59, 51.45, 50.05, 55.15, 57.84, 62.84], | ||
"Line Coverage (%)": [56.08, 59.19, 63.23, 66.47, 71.61, 77.23], | ||
"Changed Line Coverage (%)": [null, 93.76, 93.95, 95.49, 95.1, 96.13], | ||
}; | ||
const d1 = [58.93, 59.07, 58.86, 58.93, 58.73, 59.04]; | ||
const d2 = [40.94, 42.18, 41.71, 42.13, 42.69, 44.37]; | ||
const data1 = { | ||
Month: ["1月", "2月", "3月", "4月", "5月", "6月"], | ||
"Branch Coverage (%)": d1, | ||
"Line Coverage (%)": d2, | ||
"Changed Line Coverage (%)": [null, 93.76, 93.95, 95.49, 95.1, 96.13], | ||
}; | ||
// 对于shiki,我们需要一个组件,直接可以着色 | ||
|
||
const option = { | ||
title: { | ||
text: "UI自动化覆盖率", | ||
}, | ||
tooltip: { | ||
trigger: "axis", | ||
}, | ||
legend: { | ||
data: [ | ||
"Branch Coverage (%)", | ||
"Line Coverage (%)", | ||
"Changed Line Coverage (%)", | ||
], | ||
right: 10, | ||
}, | ||
grid: { | ||
left: "3%", | ||
right: "4%", | ||
bottom: "3%", | ||
containLabel: true, | ||
}, | ||
toolbox: { | ||
feature: { | ||
saveAsImage: {}, | ||
}, | ||
}, | ||
xAxis: { | ||
type: "category", | ||
boundaryGap: true, | ||
data: data.Month, | ||
}, | ||
yAxis: { | ||
type: "value", | ||
max: 100, | ||
}, | ||
series: [ | ||
{ | ||
name: "Branch Coverage (%)", | ||
type: "line", | ||
data: data["Branch Coverage (%)"], | ||
// 线上加文字 | ||
label: { | ||
show: true, | ||
position: "bottom", | ||
}, | ||
}, | ||
{ | ||
name: "Line Coverage (%)", | ||
type: "line", | ||
data: data["Line Coverage (%)"], | ||
// 线上加文字 | ||
label: { | ||
show: true, | ||
position: "top", | ||
}, | ||
}, | ||
{ | ||
name: "Changed Line Coverage (%)", | ||
type: "line", | ||
data: data["Changed Line Coverage (%)"], | ||
// 线上加文字 | ||
label: { | ||
show: true, | ||
position: "top", | ||
}, | ||
}, | ||
], | ||
}; | ||
// 参数,fileCoverage、fileContent、 | ||
|
||
function fn(fileCoverage, fileContent) { | ||
return { | ||
lines: [], //行信息 | ||
}; | ||
} | ||
|
||
const option1 = { | ||
title: { | ||
text: "UT覆盖率", | ||
}, | ||
tooltip: { | ||
trigger: "axis", | ||
}, | ||
legend: { | ||
data: [ | ||
"Branch Coverage (%)", | ||
"Line Coverage (%)", | ||
"Changed Line Coverage (%)", | ||
], | ||
right: 10, | ||
}, | ||
grid: { | ||
left: "3%", | ||
right: "4%", | ||
bottom: "3%", | ||
containLabel: true, | ||
}, | ||
toolbox: { | ||
feature: { | ||
saveAsImage: {}, | ||
}, | ||
}, | ||
xAxis: { | ||
type: "category", | ||
boundaryGap: true, | ||
data: data.Month, | ||
}, | ||
yAxis: { | ||
type: "value", | ||
max: 100, | ||
}, | ||
series: [ | ||
{ | ||
name: "Branch Coverage (%)", | ||
type: "line", | ||
data: data1["Branch Coverage (%)"], | ||
}, | ||
{ | ||
name: "Line Coverage (%)", | ||
type: "line", | ||
data: data1["Line Coverage (%)"], | ||
}, | ||
], | ||
}; | ||
const Test = () => { | ||
return ( | ||
<div> | ||
<EChartsReact | ||
className={"w-[700px]"} | ||
style={{ height: "300px" }} | ||
option={option} | ||
/> | ||
<EChartsReact | ||
className={"w-[700px]"} | ||
style={{ height: "300px" }} | ||
option={option1} | ||
/> | ||
</div> | ||
); | ||
return <div>Test</div>; | ||
}; | ||
|
||
export default Test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1 @@ | ||
# Logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
# IDE / Editor | ||
.idea/* | ||
!.idea/rcb-settings.xml | ||
|
||
# PNPM | ||
.pnpm-store | ||
|
||
|
||
pnpm-lock.yaml | ||
|
||
.env | ||
|
||
db/sql | ||
|
||
|
||
coverage | ||
|
||
schema.gql | ||
|
||
target/ | ||
Cargo.lock | ||
report |
Oops, something went wrong.