-
Notifications
You must be signed in to change notification settings - Fork 0
/
line.html
91 lines (77 loc) · 1.92 KB
/
line.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<html>
<head>
<title>Learn D3.js</title>
<style>
.line-chart {
min-width: 800px;
min-height: 500px;
margin: 20px;
}
.axis-y path {
display: none;
}
.axis-x .tick:first-child line,
.axis-x .tick:last-child line {
display: none;
}
.axis-x .tick text,
.axis-y .tick text {
font-size: 13px;
}
.overlay {
fill: none;
pointer-events: all;
cursor: pointer;
}
.dot {
cursor: pointer;
}
.dot circle {
fill: rgba(24, 144, 255, .85);
stroke: rgba(24, 144, 255, .85);
box-shadow: rgb(174, 174, 174) 0px 0px 10px;
opacity: 0;
}
.tooltip {
position: absolute;
width: 100px;
height: 40px;
padding: 2px;
border: 0px;
border-radius: 8px;
pointer-events: none;
transition: opacity .2s cubic-bezier(0.23, 1, 0.32, 1) 0s, left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s;
background-color: rgba(255, 255, 255, 0.9);
box-shadow: rgb(174, 174, 174) 0px 0px 10px;
border-radius: 3px;
color: rgb(87, 87, 87);
font-size: 13px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", SimSun, sans-serif;
line-height: 20px;
padding: 10px 10px 6px;
opacity: 0;
}
.date-txt {
display: block;
}
.val-txt {
display: block;
color: rgba(24, 144, 255, .85);
font-weight: bold;
}
.val-txt::before {
content: 'Price';
color: rgb(87, 87, 87);
margin-right: 10px;
font-weight: normal;
}
</style>
</head>
<body>
<!-- <h1>First heading</h1>
d3.select('h1').style('color', 'red');-->
<svg class="line-chart"></svg>
<script src="//d3js.org/d3.v4.min.js"></script>
<script src="line-chart.js"></script>
</body>
</html>