Apparently Charlie Chan was based on a real Chinese detective in Honolulu, Chang Apana who was a legend on the Honolulu police force.
He was, somewhat loosely. Earl Derr Biggers knew him.