-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathstatic.js
More file actions
47 lines (46 loc) · 1.03 KB
/
static.js
File metadata and controls
47 lines (46 loc) · 1.03 KB
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 Controller from '@ember/controller';
export default Controller.extend({
init() {
this._super(...arguments);
const x1 = [-3, -2, -1, 0, 1, 2, 3];
const angles = new Array(60).fill(0).map((z,i) => -Math.PI + i*2*Math.PI/60);
this.setProperties({
chartData: [{
x: x1,
y: x1.map(x => Math.pow(x,2)),
type: 'bar',
bar: {
color: '#7267ff',
}
}, {
x: angles,
y: angles.map(x => 2*Math.sin(5*x) + 10),
type: 'scatter',
line: {
color: '#ff5737',
dash: 'dash'
}
}, {
// Smily :)
x: [-0.7, 0.7, -1, -0.5, 0, 0.5, 1],
y: [6, 6, 3, 2, 1.5, 2, 3],
mode: 'markers',
type: 'scatter',
marker: {
symbol: 'x-dot',
size: 10,
color: '#9c9802'
}
}],
chartLayout: {
xaxis: {
//range: [-3.5, 3.5]
},
yaxis: {
//range: [-15, 15]
}
},
chartConfig: {}
});
},
});