speed up drawing chart by not using ajax call