optimize graph query, tweak date labels on graphs