Is there a way to display or not display a line on a line chart, based on a true / false value ( Checkbox )

I did look around and through various threads and the common way is to duplicate the columns with an IF condtion and use the NA() if false.

I am using NAMES to define the lines and tried putting a IF condition , excel did not like it , could be the way I did it.

Thanks

Idris