updating graph after click and fewer requests