This situation represents a function only. Air pressure is the independent (input) variable and the weight of the candy dispensed is the dependent variabe:
weight = 3(pressure on the lever)
This has the form of a function, as well as of a direct proportion.