I think it is better to create / recreate your x-axis in the script, maybe like (untested):
autonumberhash128 ( @5,@6 ) as [KeyVariable]
(txt, utf8, no labels, delimiter is '\t', msq);
count(KeyVariable) as KVCount,
count(KeyVariable)+peek('KVCount') as KVCumCount
resident INPUT group by [KeyVariable];
I noticed that you have used an full accumulation in your graph, that's why I (tried) also to create a cumulated count.
So your expression in the text box could maybe look like:
sum(if(KVCount= scrollValue, KVCumCount)) / max(KVCumCount)
Everything untested, sorry.