Honestly, this is overblown. Most of the budget for these corporations goes to marketing, and the R&D mostly goes to repatenting efforts or incremental repurposings. They rarely come out with anything new, and if you look at recent years you may as well say that they never do.
You hit the nail right on the head. This is the same with basically every consumer product in capitalism, which is why it’s so inappropriate for life saving medicine.
The article that graph comes from indicates that is self-reported data from the companies which may not be consistent in what is considered R&D vs. marketing cost.
Maybe I'm mistaken here, but one such case was Sofosbuvir and its pricing was indeed very controversial.
Rant. Prime time TV is now pharma pushing their drugs with the occasional programming jammed between the ads. All those ads are coming from their extreme markups. Placebo and manufacturing artifacts aside, a molecule is a molecule, buying generics should be the default.
It is bad enough, but the real disgrace is pharma salespeople masquerading as GPs prescribing meds according to who is sponsoring them. Instead of telling people about the active ingredient they send them to buy BRAND. At least this is my experience in the 2nd world.