Pull request to enable display of barometric pressure#49
Pull request to enable display of barometric pressure#49mtatsuma merged 3 commits intomtatsuma:masterfrom
Conversation
|
Thank you for your PR. Could you provide a sample picture that the pressure is enabled? I'm concerned about the visibility because the pressure graph may overwrap the other graph (e.g. rain and temperature). |
MMM-WeatherChart.js
Outdated
| (2 + (iconTopMargin + iconBelowMargin + tempRainMargin) * 2), | ||
| y2_min = 0; | ||
| y2_min = 0, | ||
| yPressure_Min = this.getMin(pressures), |
There was a problem hiding this comment.
Rename yPressure_Min, yPressure_Max to y3_min, y3_max.
MMM-WeatherChart.js
Outdated
| colorMax: "rgba(255, 255, 255, 1)", | ||
| colorRain: "rgba(255, 255, 255, 1)", | ||
| colorSnow: "rgba(255, 255, 255, 1)", | ||
| colorPressure: "rgba(255, 255, 0, 0.8)", |
There was a problem hiding this comment.
Cloud you set the default color to white?
| datasets.push({ | ||
| label: "Pressure", | ||
| borderColor: this.config.colorPressure, | ||
| pointBackgroundColor: this.config.colorPressure, |
There was a problem hiding this comment.
Cloud you set borderDash so that the line style is selectable by users? The pressure line should be easily distinguishable because the pressure line overwrap with the other lines.
For example:
borderDash: this.config.pressureBorderDash
MMM-WeatherChart.js
Outdated
| y2_min = 0; | ||
| y2_min = 0, | ||
| y3_max = maxPressure + 20, | ||
| y3_min = minPressure - 20; |
There was a problem hiding this comment.
y3_max and y3_min should be carefully calculated to make an appropriate margin. If it's difficult, I'll try to fix after the PR is merged.
| }, | ||
| }, | ||
| data: pressures, | ||
| yAxisID: "y3", |
There was a problem hiding this comment.
Hide the y3 axis at the far left side.
y1, y2 axis is hide by the below code.
https://github.com/mtatsuma/MMM-WeatherChart/blob/master/MMM-WeatherChart.js#L880-L884
… 2) Change color pressure to white 3)Added pressure border dash for line, 4) Changed calculations for y3 min and max extents, 5) Hid scale for y3
mtatsuma
left a comment
There was a problem hiding this comment.
Thank you for the modifitions.
|
I'll create a new release after I test it on my environment. |
Modification of code and readme that permits display of the barometric pressure.