Skip to content

Pull request to enable display of barometric pressure#49

Merged
mtatsuma merged 3 commits intomtatsuma:masterfrom
stavefan:pressure
Jan 18, 2023
Merged

Pull request to enable display of barometric pressure#49
mtatsuma merged 3 commits intomtatsuma:masterfrom
stavefan:pressure

Conversation

@stavefan
Copy link
Contributor

@stavefan stavefan commented Jan 5, 2023

Modification of code and readme that permits display of the barometric pressure.

@mtatsuma
Copy link
Owner

mtatsuma commented Jan 9, 2023

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).

@stavefan
Copy link
Contributor Author

stavefan commented Jan 9, 2023

Attached is a screenshot

pressure

(2 + (iconTopMargin + iconBelowMargin + tempRainMargin) * 2),
y2_min = 0;
y2_min = 0,
yPressure_Min = this.getMin(pressures),
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in commit: 90dff89

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)",
Copy link
Owner

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?

Copy link
Contributor Author

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,
Copy link
Owner

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in commit: 90dff89

y2_min = 0;
y2_min = 0,
y3_max = maxPressure + 20,
y3_min = minPressure - 20;
Copy link
Owner

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.

Copy link
Contributor Author

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",
Copy link
Owner

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

Copy link
Contributor Author

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
@stavefan stavefan requested a review from mtatsuma January 15, 2023 22:05
Copy link
Owner

@mtatsuma mtatsuma left a 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.

@mtatsuma
Copy link
Owner

I'll create a new release after I test it on my environment.

@mtatsuma mtatsuma merged commit d1203fb into mtatsuma:master Jan 18, 2023
@stavefan stavefan deleted the pressure branch January 18, 2023 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants