generates chart and pulls data