fixes #17477. Make sure labelFunc is taken into account.