The study of charm production as a function of multiplicity is important to investigate the role of multi-parton interactions, color-reconnection mechanisms, and spectra modification in high multiplicity events with respect to minimum bias ones, and to dig into the possible presence of collective phenomena in high-multiplicity environments.
Moreover, charm cross-section measurements in pp collisions provide a useful test of QCD calculations while measurements in p--Pb collisions are useful to analyze Cold Nuclear Matter effects.
In this contribution, recent measurements of the evolution of the production yields with the event charged-particle multiplicity of prompt D-mesons and leptons from heavy-flavour hadron decays in pp collisions at $\sqrt{s} =$ 13 TeV are discussed. The results are compared to the $\mathrm{J/\Psi}$ measurement and to model calculations. The $\mathrm{\Lambda_c^+/D^0}$ and $\mathrm{D_s/D^0}$ yield ratios as a function of multiplicity in pp collisions at $\sqrt{s} =$ 13 TeV are also presented. The measurements in p--Pb of the centrality-dependence of the D-meson nuclear modification factor and of the elliptic flow of heavy-flavour decay leptons in high-multiplicity events are also discussed.