The Phase Diagram and the Structure of the Charge-Density-Wave State in High Magnetic Field