Chuck D's getting screwed by a deal that's shutting down his effort to tell Public Enemy's story ... so he claims in a new lawsuit.

The legendary rapper's suing Alt House Productions because he says he agreed to let the fledgling company to produce a documentary about Spectrum City ... the group that eventually became Public Enemy. Chuck says the deal did NOT give the company exclusive rights to his story or Public Enemy's.

In docs, obtained by TMZ, Chuck admits signing an amendment to the deal which had a clause about his "life story," but says he didn't have a lawyer present, and had no clue what he was signing.

Chuck says another production company wants to tell Public Enemy's story, but the deal with Alt is mucking it up. He's suing to block Alt from locking up rights to his or his legendary group's story.

Translation: Chuck's fighting the power. Or, put another way ...