"Whenever I play Andy I know it's going to be a gruelling fight, a lot of long rallies. It could have gone either way," said the world number two.
"I could not say I dominated the match because all three sets were very close and he had some match points and opportunities to finish the match. I could have easily been a runner-up today but I'm very proud of my fight."
The win in Shanghai saw Djokovic claim his fifth title of the year.