High-resolution spectra emitted by laboratory plasmas provide invaluable diagnostic tools for the measurement of plasma properties. To be implemented, they require a large amount of atomic data and transition rates, which are available in several spectral codes. In this paper we present a new feature added to the CHIANTI code, which allows us to calculate the Zeeman splitting of spectral lines in the presence of a magnetic field with known intensity and orientation. When combined with the CHIANTI database and software to calculate level populations and line emissivities, this new feature returns the emissivities in all four Stokes parameters, that can be utilized for the measurement of the magnetic field inside laboratory plasma chambers, along with other plasma parameters. This new feature can be applied to the analysis of the emission of laboratory plasmas created in different devices.