Tried to solve generating chart & updated php