changed bargraph back to query database instead of parsing file