-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7995a3e
commit c26858e
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<HighCharts | ||
@content={{this.chartData}} | ||
@chartOptions={{this.chartOptions}} | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import Component from '@glimmer/component'; | ||
|
||
const DIRECTIONS = ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW']; | ||
const WIND_DATA = [ | ||
0, 10, 15, 10, 20, 45, 47, 90, 110, 115, 130, 150, 160, 188, 190, 185, 192, | ||
]; | ||
|
||
export default class LineBasic extends Component { | ||
chartOptions = { | ||
chart: { | ||
type: 'line', | ||
polar: true, | ||
}, | ||
title: { | ||
text: 'Wind direction history', | ||
}, | ||
xAxis: { | ||
tickInterval: 45, | ||
min: 0, | ||
max: 360, | ||
labels: { | ||
formatter: function ({ value }) { | ||
return DIRECTIONS[Math.round(value / 45)]; | ||
}, | ||
}, | ||
}, | ||
yAxis: { | ||
min: 0, | ||
max: 1, | ||
labels: { | ||
enabled: false, | ||
}, | ||
}, | ||
tooltip: false, | ||
}; | ||
|
||
chartData = [ | ||
{ | ||
name: 'Amisbühl', | ||
data: WIND_DATA.map((x, i) => ({ x, y: i / (WIND_DATA.length - 1) })), | ||
connectEnds: false, | ||
}, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters