In this paper, we adopt the network synchronization to measure the collective behavior in the financial market, and then analyze the factors that affect the collective behavior. Based on the data from the Chinese financial market, we find that the clustering coefficient, the average shortest path length and the volatility fluctuation have a positive effect on the collective behavior respectively, while the average return has a negative effect on it; the effect of the average shortest path length on the collective behavior is the greatest in the above four variables; the above results are robust against the window size and the time interval between adjacent windows of the stock network; the effect of network structures and stock market properties on the collective behavior during the financial crisis is the same as those during other periods.