-
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.
* Add support for polar charts - As per [documentation](https://www.highcharts.com/docs/chart-and-series-types/polar-chart): > Polar charts, also known as radar charts, require the highcharts-more.js file. I was also tinkering with the idea to just merge the if to the "waterfall" case below as it's essentially the same, but then decided against as it might cause issues in the future. * docs: Polar chart in test app
- Loading branch information
1 parent
d628cf5
commit 3b374c9
Showing
4 changed files
with
58 additions
and
0 deletions.
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
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