Dalbergia hancaiBenth. (D. hancai) is one of the most frequently utilized traditional Chinese medicine in Zhuang medicine. Simultaneously, it has been included in the “Quality Standard of Zhuang medicine in Guangxi Zhuang Autonomous Region (Vol. 2)” and possessed outstanding pharmacological effects. However, the pharmacodynamic material basis ofD. hancaistill remains unclear. In this study, the high-performance liquid chromatography (HPLC) method had been employed to establish the fingerprint of 10 batches of aqueous extract ofD. hancaioriginated from different parts of China. At the same time, similarity evaluation, cluster analysis, and principal component analysis (PCA) had also been conducted to evaluate the common peaks. The acetic acid-induced writhing in mice had been employed as an analgesic model, and the carrageenan-induced toe swelling in mice was utilized as an anti-inflammatory model for pharmacodynamic experiments. The gray relational analysis (GRA) and partial least squares regression (PLSR) were applied to correlate the fingerprint and pharmacodynamic data to thoroughly examine its spectrum-effect relationship, whereby its analgesic and anti-inflammatory material basis had been comprehensively explored. The results revealed that the HPLC fingerprint of the aqueous extract ofD. hancaihad successfully identified 12 common peaks whereby two of which were further identified as protocatechuic acid and vitexin. Subsequently, through the analysis of GRA and PLSR, the chromatographic peaks that possess a critical correlation degree with the analgesic and anti-inflammatory effects ofD. hancaihad also been successfully discovered. Ultimately, the analgesic and anti-inflammatory effects of the 10 batches ofD. hancaiaqueous extract had been conclusively proved, and it was evidently indicated that these effects were attributable to the synergistic interactions between various components. Therefore, this study aims to serve as an effective analytical method for screening and predicting the effective substances of traditional Chinese medicine on the basis of the spectrum-effect relationship.