Optimal charging scheduling of electric vehicles with renewable energy could greatly save the electricity cost in parking lots, and also helps for environment protection. However, uncertainties of renewable energy and electric vehicles charging demand bring great challenges to obtaining the optimal charging policy. To this end, in this paper, a state aggregation based dynamic programming method is presented for such a stochastic charging scheduling problem. Specifically, first, a new Markov decision process based formulation is established for the multi-stage stochastic programming problem. Second, a novel stateaggregation method is proposed to relieve the dimension curse due to large state-action space without sacrificing the optimality of the charging policy. Besides, the consistency of the problem before and after state aggregation also could be verified by proposed theorems both on feasibility and optimality. Moreover, economic efficiency and computational efficiency are both improved in numerical testing, which shows the effectiveness of the proposed method.