-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathnvd3-scatter.html
95 lines (86 loc) · 1.66 KB
/
nvd3-scatter.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
92
93
94
95
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="nvd3-behavior.html">
<!--
An element to create scatter chart using nvd3.
Example:
<nvd3-scatter data="[[data]]" auto-resize></nvd3-scatter>
Data Format:
```
[
{
"key": "Group One",
"values": [
{
"x": 10,
"y": 20,
"size": 69
}, {
"x": 15,
"y": 19,
"size": 85
}
]
},
{
"key": "Group Two",
"values": [
{
"x": 14,
"y": 17,
"size": 85
}, {
"x": 33,
"y": 12,
"size": 69
}
]
}
]
```
@group NVD3 Elements
@element nvd3-scatter
@demo demo/nvd3-scatter.html
@hero hero.svg
-->
<dom-module id="nvd3-scatter">
<template>
<style include="nvd3-shared-styles">
</style>
<!-- We need to put svg tag inside a div to set correct margins -->
<div>
<svg id="svg"></svg>
</div>
</template>
<script>
Polymer({
is: 'nvd3-scatter',
behaviors: [NVD3.ChartBehavior],
properties: {
/**
* NVD3 chart object.
*/
_chart: {
type: Object,
value: function() {
return nv.models.scatterChart();
}
},
/**
* Whether to display the legend or not
*/
showLegend: {
type: Boolean,
value: false
},
/**
* NVD3 components which are used in this chart.
* It's required for binding events.
*/
_components: {
type: Array,
value: ['scatter', 'legend', 'xAxis', 'yAxis', 'tooltip']
}
}
});
</script>
</dom-module>