I seem to recall as a schoolboy, long before the metric system was (partially) introduced into Britain, seeing the ‘gramme’ spelling on the back of exercise books (along with non-SI subdivisions like cent- and deci-). However when I did chemistry at secondary school in the 50s (which was all metric measurements) it was ‘grams’, and I remember being scornful of newspapers occasionally referring to metric units with the French spelling.
But I don’t have the exercise books any more so I can’t prove it.
Certainly British scientific jounals such as the Biochemical Journal always used the ‘gram’ spelling in their Instructions to authors (when defining the abbreviations, which are what are used).
So, in a way, there was a division between those that used the units (scientists) and spelled them ‘gram’, and those that didn’t (journalists) and thought the French spelling proper. But I haven’t seen the ‘gramme’ spelling for years.
P.S.
On reflection, I had the idea that perhaps the ‘gramme’ spelling was used by pharmacists, and that I had seen it on the packaging of ointments etc. (not likely to feature in Google ngram). By chance, I was talking to a pharmacist who had graduated in the 70s but he had no recollection of this. We both recalled that before the introduction of metric units, pharmacists used ‘grains’ and the like! There was a period, however, between the imperial measures being abandoned and the the strict SI unit terminology being introduced when a sort of bastard metric terminology existed. Perhaps that was the heyday of the gramme. Anyone got a tube of ointment from the 60s?