nextcloud / health

Nextcloud health app
GNU Affero General Public License v3.0
92 stars 19 forks source link

Bar portion representing `bodyfat` field of Weight graph vanishes when `mearurement` field is populated... #38

Open WNYmathGuy opened 3 years ago

WNYmathGuy commented 3 years ago

As indicated in Issue #37 I calculated the BMI via a spreadsheet using a formula found on Wikipedia. Today I decided to populate the extra field with my calculation of the BMI because the one auto calculated on the top of the Weight Module seemed to be double what I expected it to be. Judging by the chart at Wikipedia BMI chart, my calculation is correct.

I decided to use that measurement field to graph my BMI. The table populated as expected, and the records displayed at the bottom of the Weight page as expected. The other fields had no change. The BMI and Percent Body Fat values are similar so shouldn't have any trouble plotting on the secondary axis. Instead, neither is shown where before populating the measurement field the bodyfat displayed a nice thin bar graph representation.

I don't think this is worth writing a second issue, so I'll make another point here. I think the BMI math needs to be checked with respect to the mass units a person chooses and the height units that are fixed in centimeters.

datenangebot commented 3 years ago

Thanks for the help. The table and chart will be rewritten to more standard and flexible components. Due to that let me see if the chart error is gone.

Sevens I have to check The math for the bmi.

WNYmathGuy commented 3 years ago

@datenangebot it took me a while to report back, but I noticed the changes immediately after the app update went through. I was wondering how you were going to manage the data transfer with the update, but I knew you'd think of that. However, something went a bit wrong.

The weight data was there after the changes. The Mood and Sleep data did not make it back into the user interface though. I see all the data for those modules sitting in a oc_health_ces_entities table looking like JSON records but with curly-brace delimiters. I know eventually, that will get resolved so I won't try to transfer it myself.

Regarding the improved charting, I didn't like the aesthetics at first compared to the older chart. I immediately didn't like the aspect ratio of the display. I see it as a wide rectangle about 6 wide to 1 tall. The charting might be how you intended it, but it might not be either. Because it's plotting multiple units on a single axis, it's basically drawing flat lines across the whole page. The Bodyfat & Real BMI (my custom field) are somewhere near 1/10th of the Weight in pounds of a person so the auto-ranging on a single axis draws straight lines along the bottom and across the top.

I don't know how hard it would be to code this, but I have an idea to make it more user friendly and simple for the choice of graphed data.

Allow the user to select groupings to plot on the primary and secondary axis. The groupings would be all identical unit measurements. Mass unit fields would all be in one group; Weight, Target, Initial weight. Real BMI (my custom field) is in its own group alone, and your calculated Body Mass Index would also be in its own group if you made it a calculated field, also Waist size and Hip size could be in a group of their own, and so on.

By the way, while writing this response I discovered your cool interface for turning on and off graphed fields. Right after the latest upgrade, I thought the module options right-side-panel was for that. After unchecking Waist size, Hip size, and Musclepart, and seeing them still represented under the graph I thought I was stuck with them. :roll_eyes: I was going to suggest that within each grouping mentioned in the last paragraph, you should have an on/off switch associated with the fields for the user. Speaking in the vernacular, clicking the legend to turn the lines on and off is clutch. :rocket:

Double by-the-way, if you did make your built-in Body mass index an available field grouping for an axis, it would be cool if it graphed with the default boundaries of minimum and maximum the way Initial and Target weight boundaries graph with actual Weight.

datenangebot commented 3 years ago

wow, okay that is a great detailed feedback and a good way to improve my english :)

I had to change the way to store data for the modules except the weight module because of a design failure. Thats why it is still beta software. And thats way the data is gone with the update. If somebody have time to write a migration script, feel free... Therefore I do not delete the old tables yet.

About the charts: Yes you are right, I put all datasets at the same scale. A way to set a mapping for datasets and scales by the user is too complicated I guess. Not for the development, more for the ease of use for the program. I will try to map some data to the primary scale with a printed scale on the left. Additional I can add a scale printed on the right and maybe some hidden scale in the background.

Well, If you uncheck a column in the sidebar, it will be hidden in the table AND in the chart. But you see the label in the legend of the chart. Another enhancement for my chart-component... :)

The BMI column within the table and chart is already included, there was a display error, so you will see it with the next release...