In this Letter, we present a novel, to the best of our knowledge, scanning-based compressive hyperspectral imaging method via spectral-coded illumination. We achieve efficient and flexible spectral modulation by spectral coding of a dispersive light source while spatial information is obtained by point-wise scanning, which can be applied to optical scanning imaging systems such as lidar. In addition, we propose a new tensor-based joint hyperspectral image reconstruction algorithm that considers spectral correlation and spatial self-similarity to recover three-dimensional hyperspectral data from compressive sampled data. Both simulated and real experiments show that our method has superior performance in visual quality and quantitative analysis.