feat: add Gauge demo
0 parents
Showing
14 changed files
with
118 additions
and
0 deletions
.gitignore
0 → 100644
.umirc.ts
0 → 100644
package.json
0 → 100644
| 1 | { | ||
| 2 | "private": true, | ||
| 3 | "author": "niexq <niexq0319@gmail.com>", | ||
| 4 | "scripts": { | ||
| 5 | "dev": "umi dev", | ||
| 6 | "build": "umi build", | ||
| 7 | "postinstall": "umi setup", | ||
| 8 | "setup": "umi setup", | ||
| 9 | "start": "npm run dev" | ||
| 10 | }, | ||
| 11 | "dependencies": { | ||
| 12 | "@ant-design/charts": "^0.9.13", | ||
| 13 | "umi": "^4.3.20" | ||
| 14 | }, | ||
| 15 | "devDependencies": { | ||
| 16 | "@types/react": "^18.0.33", | ||
| 17 | "@types/react-dom": "^18.0.11", | ||
| 18 | "typescript": "^5.0.3" | ||
| 19 | } | ||
| 20 | } |
pnpm-lock.yaml
0 → 100644
This diff could not be displayed because it is too large.
src/assets/yay.jpg
0 → 100644
177 KB
src/layouts/index.less
0 → 100644
src/layouts/index.tsx
0 → 100644
src/pages/Gauge.tsx
0 → 100644
| 1 | import { Gauge } from '@ant-design/charts'; | ||
| 2 | |||
| 3 | const DemoGauge: React.FC = () => { | ||
| 4 | const config = { | ||
| 5 | title: { | ||
| 6 | visible: false, | ||
| 7 | text: '压力表', | ||
| 8 | }, | ||
| 9 | width: 400, | ||
| 10 | height: 400, | ||
| 11 | value: 0.75, | ||
| 12 | min: 0, | ||
| 13 | max: 1.6, | ||
| 14 | range: [0, 0.4, 0.8, 1.2, 1.6], | ||
| 15 | statistic: { | ||
| 16 | visible: true, | ||
| 17 | text: '压力表', | ||
| 18 | color: '#faad14', | ||
| 19 | }, | ||
| 20 | color: ['#39B8FF', '#52619B', '#43E089', '#C0EDF3'], | ||
| 21 | format: (v: number) => { | ||
| 22 | return Number(v).toFixed(1); | ||
| 23 | }, | ||
| 24 | }; | ||
| 25 | return <Gauge {...config} />; | ||
| 26 | }; | ||
| 27 | |||
| 28 | export default DemoGauge; | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
src/pages/docs.tsx
0 → 100644
src/pages/index.tsx
0 → 100644
tsconfig.json
0 → 100644
typings.d.ts
0 → 100644
| 1 | import 'umi/typings'; |
-
Please register or sign in to post a comment