I don't think there is any simple answer to this question. Each case needs to be thought through and a decision made on the circumstances of the case.
The general rule I use is that where the demerger is the hiving off of a smallish part of the business, I would adjust the chart. I used this procedure for BHP as it demerged. I such cases, what is left of the original company is a large part and therefore the price history would seem relevant. I also used this rule for Amcor.
However, where the business is split into two large businesses and there are reservations as to whether the new business carrying on the original name and corporate structure is really the same as the original one, I would disregard the price history as not being relevant. I applied this rule to Boral, CSR and WMC because my judgement was that the nature of the remaining business was different to the remaining business in that corporate vehicle.
I use the same rule for backdoor listings. Where a new business is floated in the shell of the old listing, I disregard the history and treat it as a new listing. It makes no sense to me to join a history of a gold explorer onto the price action for an Internet start-up, for example.
As to how you actually adjust the chart, there are several possible approaches. The classic one is to use a dilution factor. You would base this on the opening price of the hived off part of the demerger to establish a factor that is applied to all past data. However, in practice this does not always work very well. Sometimes the market seems to make a much larger adjustment, or a smaller one, or no adjustment at all. Where the first method opens up a big gap on the chart that was not there or not so large without an adjustment, I would consider calculating the factor based on the opening post demerger price and the closing pre demerger price.
There is also a case for making an adjustment by taking the opening price of the hived off stock off all past prices for the remaining larger part of the business. Most charting software does not let us do this, so it needs to be a clear and special case that would justify making an effort to adjust the data by hand somehow. This adjustment is notionally the reverse of a call on a contributing share or instalment receipt, also a real problem to do properly in most charting software and done incorrectly by many data vendors - Telstra is the best known example.