Added separate graphs for temperature and brightness

Also added correction factor for temperature correction.
Refactored DB code

Added separate function for date formatting and created function
for fetch with criteria.