Xi was never elected to his position by the people of China.
Being a bad president isn't the same thing as being a dictator.
Trump is not a dictator, but not because he was elected, but because of our courts and federal system (and theoretically Congress).