If the legend is for a service layer, it is not possible. The legend will show all of the layer's symbols, regardless of the current extent. If the legend is for a client-side graphics layer, we enable this setting for you, so yes: the legend will show only the symbols that can be seen in the current extent.