-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
61 lines (55 loc) · 1.65 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>SvgChart</title>
<style type="text/css">
[data-svgchart] {
margin: 50px auto;
width: 500px;
height: 400px;
background-color: #ddd;
}
</style>
</head>
<body>
<!--
<svg id="bar_chart_test" class="chart" xmlns="http://www.w3.org/2000/svg">
<style>@import url(../dist/svgchart.0.0.1.css);</style>
<rect width="20" height="20" fill="red"></rect>
<rect width="20" height="20" fill="red"></rect>
<rect width="20" height="20" fill="red"></rect>
<rect width="20" height="20" fill="red"></rect>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<style type="text/css">
circle {
stroke: #006600;
fill: #00cc00;
}
</style>
<circle cx="40" cy="40" r="24"/>
</svg>
-->
<div data-svgchart="">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" >
<polygon id="star" points="100,10 40,180 190,60 10,60 160,300"
style="
fill:lime;
stroke:purple;
stroke-width:5;
fill-rule:evenodd;
"
>
</svg>
</div>
</body>
<script type="text/javascript">
var chart = document.querySelector("[data-svgchart]");
var star = document.querySelector("#star");
star.style.fill = "lime";
star.style.stroke = "purple";
star.style.strokeWidth = "2";
star.style.fillRule = "evenodd";
</script>
</html>