Morgan Freeman had already played a black President in the movies years before that.
Nobody voted for Barack 0bama because of 24. In fact, I doubt many of the people who watch 24 would even have been part of his constituency.
Well, that’s what some people believe. In fact, there was a quote from the actor who played the president, taking credit for getting Obama elected because of his TV role, FWIW.