forked from trading-peter/chart-elements
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chart-bubble.js
47 lines (41 loc) · 1.13 KB
/
chart-bubble.js
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
import { LitElement } from 'lit-element/lit-element.js';
import { ChartPropertyMixin } from './chart-property-mixin';
import { ContextMixin } from './context-mixin';
import { ResizeMixin } from './resize-mixin.js';
/**
A bubble chart is used to display three dimensions of data at the same time.
The location of the bubble is determined by the first two dimensions and the corresponding horizontal and vertical axes.
The third dimension is represented by the size of the individual bubbles.
##### Example
<chart-bubble data="[[data]]"></chart-bubble>
...
this.data = {
datasets: [{
label: "My First dataset",
backgroundColor: "rgba(220,220,220,0.2)",
borderColor: "rgba(220,220,220,1)",
borderWidth: 1,
data: [
{
x: 20,
y: 30,
r: 15
},
{
x: 40,
y: 10,
r: 10
}
]
}]
};
@group Chart Elements
@element chart-bubble
*/
class ChartBubble extends ResizeMixin(ContextMixin(ChartPropertyMixin(LitElement))) {
constructor() {
super();
this.__type = 'bubble';
}
}
window.customElements.define('chart-bubble', ChartBubble);