-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
41 lines (40 loc) · 1.15 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>Flourish API: CSV Example</title>
<script src="https://d3js.org/d3-dsv.v1.min.js"></script>
<script src="https://d3js.org/d3-fetch.v1.min.js"></script>
<script src="https://cdn.flourish.rocks/flourish-live-v5.min.js"></script>
</head>
<body>
<div id="chart"></div>
<script>
d3.csv("example-data.csv").then(function(raw_data) {
var my_visualisation = new Flourish.Live({
template: "@flourish/scatter",
version: "22",
container: "#chart",
api_key: "************ YOUR API KEY GOES HERE! ************",
state: {
layout: {
title: "This chart was generated from an external CSV file",
subtitle: "The CSV file was imported from a local csv using D3, and turned into a chart using the Flourish API"
}
},
data: {
data: raw_data
},
bindings: {
data: {
x: "Life expectancy",
y: "GDP",
color: "Region",
size: "Population",
name: ["Country"]
}
}
});
});
</script>
</body>
</html>