Replace the entire check for temp_units = C with a check for barometer_units = mb OR hPa: “$weather["temp_units"]=='C'” is replaced with “$weather["barometer_units"]=='mb' OR $weather["barometer_units"]=="hPa"”.
Then do the same replacing the checks for temp_units = F with a check for barometer_units = inHg: “$weather["temp_units"]=='F'” is replaced by “$weather["temp_units"]=='F'”.
Originally, it checked for if Celcius was used, and if so it would assume you were using mb/hPa, or if Fahrenheitn was used, it would assume you used inHg instead. At the same time, it would pull the number from the database as the barometer units you specified in the setup, so it could mix up the units and have some crazy conversions, and used the wrong scale on the graph. With this change, instead of using temperature to assume the barometer units you want to use, it simply checks which units you set it to use instead.