The satisfactory performances of electronic structures, electronic and optical properties based on pure graphene and different components graphene of doping N, doping In and doping N-In were acquired by First-principle calculations. The pure graphene is an excellent semiconductor material with the zero gap. However, when graphene is doped with N, In and N-In, the gaps of energy will be opened. In the results of three different doping, the gap values of N, In and N-In are 0.2, 0.37 and 0.51 eV, respectively. In N-doped graphene, as the electrons leave the carbon, electrons are trapped by the nitrogen. On the contrary, electrons leave the indium atom and are picked up by the carbon for the In-doped graphene. When graphene is doped with N-In, more electrons (0.61 e) will be lost to nitrogen atoms compared with N-doped graphene (0.27 e) and more electrons (1.97 e) will be obtained to indium atoms compared with In-doped graphene (1.93 eV). After N, In, N-In doping, the overall strength of graphene absorption peaks will be weakened, which is more obvious for low-frequency peaks of graphene-doped with N and In. Pure graphene and N-In-doped graphene have similar absorption curves, but the difference between them is that the peak value of low-frequency absorption peak of N-In-doped graphene will be decreased compared with pure graphene. It is a satisfactory result to fully demonstrate that the band gap of graphene-doped system can be better regulated by the addition of nitrogen and indium atoms.