It is of great importance to power the nodes of the rechargeable wireless sensor network to detect events continuously in the area of interest. This paper proposes a joint data transmission and on‐demand charging algorithm based on the space correlation. The new algorithm optimises the event detection, data forwarding and node charging jointly to improve the charging efficiency. First, the active nodes participating in the event detection are selected using an improved iterative node selection method to reduce the number of nodes working concurrently. Then, the greedy data transmission scheme based on grid partition is proposed to transmit the observed data to the sink node. Finally, the nodes in the networks are charged using the on‐demand charging method based on grid partition, which greatly decreases the charging frequency and energy loss of the mobile charger. The simulation results demonstrate that the proposed method has superior performance in the distance travelled by the mobile charger, the energy utilisation, the average energy consumption of the mobile charger and the node charging latency.