The max RPM used to scale the bargraph is the one that is set in the ECU by the user (normally not touched so just the value set for the engine by the factory)
I have applied the same principle to the "fuel left in tank", the max bargraph value is the tank volume from the ECU which is also set by the user.