In this paper we analyse an analytical solution of the Einstein - Maxwell field equations which considers matter with anisotropic pressures in a static and spherically symmetric geometry. We report the manner in which we obtain the solution, which is by means of the Karmarkar condition. For the model we assume a state equation which describes the interaction of the matter of quarks P=(c2 ρ -4Bg)/3 and we consider the presence of electric charge which can generate that the radial and tangential pressures are not equal, in a graphic manner we analyse the physical properties of the model taking as the observational data those of mass 1M⊙ and radius 7.69 km which were reported for the star Her-X1. The charge values are found between 5.57x 1018C≤ Q ≤ 1.31x 1020C and the interval of the Bag constant Bg ∈ [118.7,122.13] MeV/fm 3. Also, we show the stability of the configuration by means of the static stability criteria of Harrison - Zeldovich - Novikov ( ∂M/∂ρ0>0 ), as well as in regards to infinitesimal radial adiabatic perturbation, since the adiabatic index γ >3.3 which guarantees the stability of the solution.