Yes, but the viability of charging an EV with solar panels is dependent on a variety of parameters, including average daily sunshine and solar panel configuration.
A house rooftop solar panel arrangement with proper charging equipment is one alternative for individuals who have enough sunshine and are ready to make the initial expenditure.
Unfortunately, solar panels do not currently provide enough energy to be put on an EV and used to charge it continually.