Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from snaptec/master
1.49c
- Loading branch information
Showing
9 changed files
with
87 additions
and
6 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
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,15 @@ | ||
#!/bin/bash | ||
|
||
. /var/www/html/openWB/openwb.conf | ||
data=$(curl -s https://api.corrently.io/core/gsi?plz=$plz) | ||
rm /var/www/html/openWB/ramdisk/gsiforecast.csv | ||
|
||
echo $data |jq -r '.forecast[] | "\(.epochtime) \(.gsi)"' | while read line | ||
do | ||
time=$(echo $line | awk '{print $1;}') | ||
ftime=$(date -d@"$time" +%d"Day"-%H"H") | ||
gsi=$(echo $line | awk '{print $2;}') | ||
|
||
echo "$ftime,$gsi" >> /var/www/html/openWB/ramdisk/gsiforecast.csv | ||
done | ||
|
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,29 @@ | ||
|
||
am4core.useTheme(am4themes_animated); | ||
// Create chart instance | ||
var chart = am4core.create("gsidiv", am4charts.XYChart); | ||
// Set up data source | ||
chart.dataSource.url = "/openWB/ramdisk/gsiforecast.csv"; | ||
//} | ||
chart.validateData(); | ||
chart.dataSource.parser = new am4core.CSVParser(); | ||
chart.dataSource.parser.options.useColumnNames = false; | ||
|
||
// Create axes | ||
var categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis()); | ||
categoryAxis.dataFields.category = "col0"; | ||
|
||
// Create value axis | ||
var valueAxis = chart.yAxes.push(new am4charts.ValueAxis()); | ||
valueAxis.title.text = "GSI"; | ||
|
||
var series1 = chart.series.push(new am4charts.LineSeries()); | ||
series1.dataFields.valueY = "col1"; | ||
series1.dataFields.categoryX = "col0"; | ||
series1.name = "gsi"; | ||
series1.fill = am4core.color("#ff0000"); | ||
series1.stroke = am4core.color("#ff0000"); | ||
series1.strokeWidth = 3; | ||
series1.strokeWidth = 1.5; | ||
series1.fillOpacity = 0.3; | ||
// Add legend |
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
1.49 b Beta | ||
1.49 c Beta |