-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathchart-scatter.js
61 lines (55 loc) · 1.11 KB
/
chart-scatter.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import Component from '@glimmer/component';
import Highcharts from 'highcharts';
const totalData = 100000;
export default class Scatter extends Component {
get chartData() {
let data = [];
for (let i = 0; i < totalData; i += 1) {
data.push([
Math.pow(Math.random(), 2) * 100,
Math.pow(Math.random(), 2) * 100,
]);
}
return [
{
data,
type: 'scatter',
color: 'rgba(152,0,67,0.1)',
marker: {
radius: 1,
},
tooltip: {
followPointer: false,
pointFormat: '[{point.x:.1f}, {point.y:.1f}]',
},
},
];
}
chartOptions = {
chart: {
zoomType: 'xy',
},
xAxis: {
min: 0,
max: 100,
gridLineWidth: 1,
},
yAxis: {
// Renders faster when we don't have to compute min and max
min: 0,
max: 100,
minPadding: 0,
maxPadding: 0,
},
title: {
text: `Scatter chart with ${Highcharts.numberFormat(
totalData,
0,
' ',
)} points`,
},
legend: {
enabled: false,
},
};
}