We are unable to vary the strength of gravity in the lab, so the way we can do this is to use a computer simulation. Check out the PhET Physics Simulations, and in particular the Pendulum simulation. When running the simulation, focus on the gravity portion, where you can vary it using earth, moon, Jupiter, and no gravity. Use the measuring tools to measure the period for each gravity setting, and you will use these data points to plot period (y-axis) vs. g (x-axis) in Excel, to get a best fit function. Click on the image below to launch the simulation from here.
Some useful data: Earth g = 9.8 m/s^2; Jupiter g = 24.8 m/s^2; Moon g = 1.6 m/s^2.