You can bind it so net_graph turns on by doing:
bind "key" "net_graph 1"
To bind a key so that net_graph turns on and off upon pressing the button, you can do the following:
bind "key" "incrementvar net_graph 0 1 1"
bind "key" "toggle net_graph"
or:
bindtoggle "key" "net_graph"
An explanation for incrementvar:
incrementvar CVAR MINVALUE MAXVALUE DELTA
CVAR: A console variable we want to change.
MINVALUE: A minimum limit for our variable.
MAXVALUE: A maximum limit for our variable.
DELTA: The amount to increase CVAR by. Set this to a negative number to decrement.
- Note: Incrementing a variable past the MAXVALUE specified causes the variable to loop around to the MINVALUE. The same happens the other way around, too.