Energy distribution of relativistic electrons in the kiloparsec scale jet of M 87 with Chandra