-
Notifications
You must be signed in to change notification settings - Fork 5
/
demo.html
59 lines (48 loc) · 1.55 KB
/
demo.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="logo" type="image/png" href="demo.png" />
<title>Demo Radar chart D3</title>
<style>
body{font-family: sans-serif}
</style>
</head>
<body>
<div style='width:100%;display:block;'>
<h2>Example of radar chart</h2>
<h4><a href='https://github.com/alangrafu/radar-chart-d3'>https://github.com/alangrafu/radar-chart-d3</a></h4>
<div id="chart" style='float:left'></div>
<div style='float:left'>
Code:
<pre>
d = [
{axis: "strength", value: 13, order:0},
{axis: "intelligence", value: 1, order:1},
{axis: "charisma", value: 8, order:2},
{axis: "dexterity", value: 4, order:3},
{axis: "luck", value: 10, order:4},
{axis: "azole", value: 10, order:5}
]
];
RadarChart.draw("#chart", d);
</pre>
</div>
</div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="src/radar-chart.js"></script>
<script>
var d = [
{axis: "strength", value: 13, order:0},
{axis: "intelligence", value: 1, order:1},
{axis: "charisma", value: 8, order:2},
{axis: "dexterity", value: 4, order:3},
{axis: "luck", value: 10, order:4},
{axis: "azole", value: 10, order:5}
];
RadarChart.draw("#chart", d);
//This function generates a new array with 3 objects every time. The values for each axis are randomized
//In order to re-generate the radar chart, you jsut need to run RadarChart.draw("#chart2", data) as usual.
</script>
</body>
</html>