-
Notifications
You must be signed in to change notification settings - Fork 0
/
open-space.html
44 lines (37 loc) · 1.12 KB
/
open-space.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
<html>
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script type="text/javascript" src="https://vega.github.io/vega/vega.min.js"></script>
<script type="text/javascript" src="https://npmcdn.com/arcgis-cedar/dist/cedar.js"></script>
</head>
<body>
<div class="row">
<div style="width: 300px; height: 300px" id="chart"></div>
</div>
<script>
var chart = new Cedar({"type": "bar"});
//create the dataset w/ mappings
var dataset = {
"url":"https://services6.arcgis.com/0p6i4J6xhQas4Unf/arcgis/rest/services/performance/FeatureServer/0",
"query": {
"where":"Performance_Measure='Acres of publicly accessible open space '"
},
"mappings":{
"sort": "End_Date DESC",
"x": {"field":"Year","label":"Year"},
"y": {"field":"Performance","label":"Total acres"}
}
};
chart.tooltip = {
"title": "{Year}",
"content": "{Performance} total acres of publicly accessible open space"
};
//assign to the chart
chart.dataset = dataset;
//show the chart
chart.show({
elementId: "#chart"
});
</script>
</body>
</html>