请使用html语言绘制一个电压波动和电压暂降的曲线,数据量不低于500个。
时间: 2024-03-06 22:51:53 浏览: 114
以下是一个使用HTML语言绘制电压波动和电压暂降曲线,数据量不低于500个的示例代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>电压波动和电压暂降曲线</title>
<style>
/* 定义样式 */
.chart {
width: 800px;
height: 400px;
border: 1px solid #ccc;
margin: 20px auto;
position: relative;
}
.label-y {
position: absolute;
left: -60px;
top: 0;
bottom: 0;
margin: auto;
font-size: 14px;
color: #999;
text-align: center;
transform: rotate(-90deg);
transform-origin: 50% 50%;
}
.label-x {
position: absolute;
bottom: -30px;
left: 0;
right: 0;
margin: auto;
font-size: 14px;
color: #999;
text-align: center;
}
.line {
fill: none;
stroke: #0077cc;
stroke-width: 2px;
}
.dot {
fill: #0077cc;
stroke: #fff;
stroke-width: 2px;
}
.dot:hover {
fill: #fff;
stroke: #0077cc;
}
</style>
</head>
<body>
<div class="chart">
<svg width="100%" height="100%">
<!-- Y轴标签 -->
<text x="-200" y="200" class="label-y">电压(V)</text>
<!-- X轴标签 -->
<text x="400" y="420" class="label-x">时间(s)</text>
<!-- 波形图 -->
<path class="line" d="M0,200
10,210 20,198 30,215 40,195 50,200 60,205 70,195 80,205 90,198 100,200
110,210 120,198 130,215 140,195 150,200 160,205 170,195 180,205 190,198 200,200
210,210 220,198 230,215 240,195 250,200 260,205 270,195 280,205 290,198 300,200
310,210 320,198 330,215 340,195 350,200 360,205 370,195 380,205 390,198 400,200
410,210 420,198 430,215 440,195 450,200 460,205 470,195 480,205 490,198 500,200
510,210 520,198 530,215 540,195 550,200 560,205 570,195 580,205 590,198 600,200
610,210 620,198 630,215 640,195 650,200 660,205 670,195 680,205 690,198 700,200
710,210 720,198 730,215 740,195 750,200 760,205 770,195 780,205 790,198 800,200
810,210 820,198 830,215 840,195 850,200 860,205 870,195 880,205 890,198 900,200
910,210 920,198 930,215 940,195 950,200 960,205 970,195 980,205 990,198 1000,200
1010,210 1020,198 1030,215 1040,195 1050,200 1060,205 1070,195 1080,205 1090,198 1100,200
1110,210 1120,198 1130,215 1140,195 1150,200 1160,205 1170,195 1180,205 1190,198 1200,200
1210,210 1220,198 1230,215 1240,195 1250,200 1260,205 1270,195 1280,205 1290,198 1300,200
1310,210 1320,198 1330,215 1340,195 1350,200 1360,205 1370,195 1380,205 1390,198 1400,200
1410,210 1420,198 1430,215 1440,195 1450,200 1460,205 1470,195 1480,205 1490,198 1500,200
1510,210 1520,198 1530,215 1540,195 1550,200 1560,205 1570,195 1580,205 1590,198 1600,200
1610,210 1620,198 1630,215 1640,195 1650,200 1660,205 1670,195 1680,205 1690,198 1700,200
1710,210 1720,198 1730,215 1740,195 1750,200 1760,205 1770,195 1780,205 1790,198 1800,200
1810,210 1820,198 1830,215 1840,195 1850,200 1860,205 1870,195 1880,205 1890,198 1900,200
1910,210 1920,198 1930,215 1940,195 1950,200 1960,205 1970,195 1980,205 1990,198 2000,200
2010,210 2020,198 2030,215 2040,195 2050,200 2060,205 2070,195 2080,205 2090,198 2100,200
2110,210 2120,198 2130,215 2140,195 2150,200 2160,205 2170,195 2180,205 2190,198 2200,200
2210,210 2220,198 2230,215 2240,195 2250,200 2260,205 2270,195 2280,205 2290,198 2300,200
2310,210 2320,198 2330,215 2340,195 2350,200 2360,205 2370,195 2380,205 2390,198 2400,200
2410,210 2420,198 2430,215 2440,195 2450,200 2460,205 2470,195 2480,205 2490,198 2500,200
2510,210 2520,198 2530,215 2540,195 2550,200 2560,205 2570,195 2580,205 2590,198 2600,200
2610,210 2620,198 2630,215 2640,195 2650,200 2660,205 2670,195 2680,205 2690,198 2700,200
2710,210 2720,198 2730,215 2740,195 2750,200 2760,205 2770,195 2780,205 2790,198 2800,200
2810,210 2820,198 2830,215 2840,195 2850,200 2860,205 2870,195 2880,205 2890,198 2900,200
2910,210 2920,198 2930,215 2940,195 2950,200 2960,205 2970,195 2980,205 2990,198 3000,200
3010,210 3020,198 3030,215 3040,195 3050,200 3060,205 3070,195 3080,205 3090,198 3100,200
3110,210 3120,198 3130,215 3140,195 3150,200 3160,205 3170,195 3180,205 3190,198 3200,200
3210,210 3220,198 3230,215 3240,195 3250,200 3260,205 3270,195 3280,205 3290,198 3300,200
3310,210 3320,198 3330,215 3340,195 3350,200 3360,205 3370,195 3380,205 3390,198 3400,200
3410,210 3420,198 3430,215 3440,195 3450,200 3460,205 3470,195 3480,205 3490,198 3500,200
3510,210 3520,198 3530,215 3540,195 3550,200 3560,205 3570,195 3580,205 3590,198 3600,200
3610,210 3620,198 3630,215 3640,195 3650,200 3660,205 3670,195 3680,205 3690,198 3700,200
3710,210 3720,198 3730,215 3740,195 3750,200 3760,205 3770,195 3780,205 3790,198 3800,200
3810,210 3820,198 3830,215 3840,195 3850,200 3860,205 3870,195 3880,205 3890,198 3900,200
3910,210 3920,198 3930,215 3940,195 3950,200 3960,205 3970,195 3980,205 3990,198 4000,200
4010,210 4020,198 4030,215 4040,195 4050,200 4060,205 4070,195 4080,205 4090,198 4100,200
4110,210 4120,198 4130,215 4140,195 4150,200 4160,205 4170,195 4180,205 4190,198 4200,200
4210,210 4220,198 4230,215 4240,195 4250,200 4260,205 4270,195 4280,205 4290,198 4300,200
4310,210 4320,198 4330,215 4340,195 4350,200 4360,205 4370,195 4380,205 4390,198 4400,200
4410,210 4420,198 4430,215 4440,195 4450,200 4460,205 4470,195 4480,205 4490,198 4500,200
4510,210 4520,198 4530,215 4540,195 4550,200 4560,205 4570,195 4580,205 4590,198 4600,200
4610,210 4620,198 4630,215 4640,195 4650,200 4660,205 4670,195 4680,205 4690,198 4700,200
4710,210 4720,198 4730,215 4740,195 4750,200 4760,205 4770,195 4780,205 4790,198 4800,200
4810,210 4820,198 4830,215 4840,195 4850,200 4860,205 4870,195 4880,205 4890,198 4900,200
4910,210 4920,198 4930,215 4940,195 4950,200 4960,205 4970,195 4980,205 4990,198 5000,200" />
阅读全文