-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pull request to enable display of barometric pressure #49
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
@@ -784,7 +864,10 @@ Module.register("MMM-WeatherChart", { | |||
y2_max = | |||
Math.max(maxRain, maxSnow, this.config.rainMinHeight) * | |||
(2 + (iconTopMargin + iconBelowMargin + tempRainMargin) * 2), | |||
y2_min = 0; | |||
y2_min = 0, | |||
yPressure_Min = this.getMin(pressures), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename yPressure_Min, yPressure_Max to y3_min, y3_max.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in commit: 90dff89
MMM-WeatherChart.js
Outdated
@@ -45,6 +46,7 @@ Module.register("MMM-WeatherChart", { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cloud you set the default color to white?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in commit: 90dff89
datasets.push({ | ||
label: "Pressure", | ||
borderColor: this.config.colorPressure, | ||
pointBackgroundColor: this.config.colorPressure, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in commit: 90dff89
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in commit: 90dff89
}, | ||
}, | ||
data: pressures, | ||
yAxisID: "y3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in commit: 90dff89
… 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.