Solar panels need direct sunlight to make decent power.
If you're going to leave the charger on long term, get one with a battery charge controller. Cheap ones just dump current into the battery without sensing battery voltage and can over charge it. I made my own charger with a controller and a panel and it did not keep my vehicle battery charged as well as I hoped. Putting it on the dashboard was probably the problem. Just not enough direct sunlight.
If you have power on site just not at the barn, and you know when your long periods of inactivity will be, it might be better to remove the battery and hook it up to a good quality charger.