This should be interesting, also how did the fight between Chu Yan and Lu Bu go in the legends since I heard in the historical records they were a stalemate
Oh! Well, I'll see if I can answer that for you.
In 185, during a raid on the city of Yingtao in Shangdang, one of the leaders of the Heishan Bandits, Zhang Niujie, died. To honour his fallen leader, Chu Yan changed his name to Zhang Yan, which is the name he is most commonly known as in history.
In the legends/Romance, Zhang Yan is barely mentioned. The campaigns of Yuan Shao only get a cursory mention, and after Lu Bu flees Chang'an, it skips over his subsequent adventures. So, will only talk about history for this.
After the Yellow Turban Rebellion was quelled, Zhang Yan began uniting all manner of local tribes, bandits, outlaws, vagrants, fugitives, former Yellow Turbans, hill chiefs, gangs, criminals, rebels and others until their numbers swelled in the tens of thousands. (History says they numbered a million but this is an exaggeration) Ji Province and Yan Province, both weakened heavily by the brief but brutal Yellow Turban Rebellion, suffered heavily under raids and pillaging. Eventually, the Han government had enough. Ding Yuan was given the authority to raise troops, and the court sent veteran general Zhu Jun with an army. They fought in Bing Province, but the battle was inconclusive. Coffers of the Han court were already running dry, and the Liang Province rebellion was a far larger concern, not to mention wars against the Wuhuan in the north east, rebels in Jing and Yellow Turban resurgencies elsewhere. The Imperial Court decided to basically "promote" Zhang Yan by giving him an official rank and a fat bribe, and more or less ceded much of northern and eastern Bing to him, in exchange for peace. Zhang Yan gladly accepted. Was Lu Bu part of Ding Yuan's army? Probably, but we can't say for sure.
Just a few years later, with Dong Zhuo in the capital, Zhang Yan sensed an opportunity. Ding Yuan was dead, and the Bing Province army had been absorbed by Dong Zhuo. Local warlords were raising arms against the tyrant, plunging the realm into total civil war. Heishan bandit raids began again in earnest, once more plundering Ji and Yan provinces. One reason why some of the warlords of the anti-Dong coalition were unable to really do much against the tyrant was because their homes were literally burning due to raids by outlaws, and many had to leave the coalition to return to protect their bases.
Skipping ahead another few years, after killing Dong Zhuo and being driven out from Chang'an by Li Jue and the other remnants, Lu Bu wandered the land for a while with his small army. Most of his force seemed to be made up of men who had followed him from Bing Province, including the likes of Gao Shun and Zhang Liao. First he tried to ally with Yuan Shu, but that didn't go well, so Lu Bu tried his luck with the other Yuan brother, Shao, who was building up his forces, hiring mercenaries and recruiting warriors.
Yuan Shao had gotten pretty sick of Zhang Yan and the other bandit chiefs raiding his lands. He also coveted Bing Province for himself - a vacuum had been left there after Ding Yuan's death, and fighting had broken out there in Shangdang between Zhang Yan's allies, and Gao Gan - Yuan Shao's nephew. Not only that, but one of Zhang Yan's top lieutenants, "Poison" Yu Du, stormed Yuan Shao's capital and kidnapped his family, and although defectors within the bandit ranks returned them unharmed, Shao was furious. Desiring to purge the Heishan bandits from the mountains once and for all, Yuan Shao lead a massive campaign against them. For this, he hired Lu Bu as his vanguard. Lu Bu did very well against the bandits, leading the tip of the spear that drove them steadily to the north. However, Lu Bu wasn't a particularly gracious man, and would often boast and brag and demean Yuan Shao. Not only that, but some of Lu Bu's subordinates, such as Chang Lian, used this chance to do a little pillaging of their own, and Lu Bu was either unable or unwilling to stop them. This lead to relations between Yuan Shao and Lu Bu to quickly sour, and, a failed assassination attempt against him later, Lu Bu fled south of the Yellow River with his army, to the Central Plains. Zhang Yan meanwhile took advantage of this infighting to withdraw further north, deeper into the mountains, and made alliances with several Xiongnu and Wuhuan chieftains who were also enemies of the Yuan, as well as making an alliance with Gongsun Zan. Unable to finish off Zhang Yan, and with other concerns occupying him, Yuan Shao eventually just left him alone. Lu Bu would meanwhile have a brief, but explosive impact on the careers of Cao Cao and Liu Bei, before coming to his end.
As for Zhang Yan? After all he had done, after all his crimes, he was eventually allowed to...retire. During his conquest of the north, Cao Cao convinced Zhang Yan to surrender, giving him a large estate and fief to retire on and live the rest of his life in luxury. His men dispersed or joined with Cao Cao. Zhang Yan would pass away peacefully some years later, rich and content, one of the few warlords of this era able to just
retire.
Hope that answers your question.