Ballistic semiconductor structures have allowed the realization of optics-like phenomena in electronic systems, including the magnetic focusing and electrostatic lensing of electrons. An extension that appears unique to graphene is to use both n and p carrier types to create electronic analogues of optical devices with both positive and negative indices of refraction. Here, we use the gate-controlled density of both p and n carrier types in graphene to demonstrate the electronic analogue of fibre-optic guiding. Two basic effects are investigated: bipolar p-n junction guiding, based on the principle of angle-selective transmission through the interface between the graphene and the p-n junction; and unipolar fibre-optic guiding, using total internal reflection controlled by carrier density. We also demonstrate modulation of the guiding efficiency through gating, and comparison of these data with numerical simulations indicates that guiding performance is limited by the roughness of the interface. The development of p-n and fibre-optic guiding in graphene may lead to electrically reconfigurable wiring in high-mobility devices.