Shared Voltmeter for 2 DC Circuits at Different Voltages (battery & solar)
Because you don't know how the solar panel is wired into the charge controller, I'd suggest that you simply use a DPDT switch.  This allows you to move the voltmeter between the two sources without any interaction.

You could also use a DPDT Center-Off switch, which allows you to disconnect the voltmeter completely if you wish.

Note that the solar panel voltage may be significantly higher than that of the battery, especially during a very bright sunny day with your battery fully charged.