Skip to content

Commit

Permalink
Merge pull request #18 from mtatsuma/rain_range
Browse files Browse the repository at this point in the history
Enable to configure the min height for rain volume
  • Loading branch information
mtatsuma authored Dec 16, 2020
2 parents 7c56925 + 5020f12 commit d2309de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MMM-WeatherChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Module.register("MMM-WeatherChart", {
showIcon: false,
showRain: false,
rainUnit: "mm",
rainMinHeight: 0.01,
color: 'rgba(255, 255, 255, 1)',
backgroundColor: 'rgba(0, 0, 0, 0)',
fillColor: 'rgba(255, 255, 255, 0.1)',
Expand Down Expand Up @@ -286,7 +287,7 @@ Module.register("MMM-WeatherChart", {
// Set Y-Axis range not to overlap each other
let y1_max = iconLine[0] + (maxTemp - minTemp) * 0.1,
y1_min = minTemp - (maxTemp - minTemp) * 0.2,
y2_max = Math.max(maxRain * 2.5, 0.1),
y2_max = Math.max(maxRain, this.config.rainMinHeight) * 2.8,
y2_min = 0;
if (this.config.showRain) {
y1_min = y1_min - (maxTemp - minTemp);
Expand Down Expand Up @@ -412,7 +413,7 @@ Module.register("MMM-WeatherChart", {
// Set Y-Axis range not to overlap each other
let y1_max = iconLine[0] + (maxValue - minValue) * 0.1,
y1_min = minValue - (maxValue - minValue) * 0.2,
y2_max = Math.max(maxRain * 3.2, 0.1),
y2_max = Math.max(maxRain, this.config.maxRain) * 3.2,
y2_min = 0;
if (this.config.showRain) {
y1_min = y1_min - (maxValue - minValue);
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ $ git clone https://github.com/mtatsuma/MMM-WeatherChart.git
| showIcon | | `false` | Show weather Icon on the top |
| showRain | | `false` | Show rain volume on the bottom |
| rainUnit | | `mm` | Unit of rain volume (`mm` or `inch`). For `mm` unit, the value is rounded to the first decimal place. For `inch` unit, the value is rounded to the second decimal place. |
| rainMinHeight | | `0.01` | Minimum height (in mm or inch) of the rain volume chart. When the max rain volume in the chart is less than this value, the height of chart is set as this value. Otherwise, the height of the chart is set acoording to the max rain volume. |
| color | | `rgba(255, 255, 255, 1)` | Color of line and letters |
| backgroundColor | | `rgba(0, 0, 0, 0)` | Color of background |
| fillColor | | `rgba(255, 255, 255, 0.1)` | Color for filling rain volume line |
Expand Down

0 comments on commit d2309de

Please sign in to comment.