avoid error in charts in case of null values

avoid error in charts in case of null values