Solar panels have set a new record for electricity generation, providing nearly a quarter of the demand.