Can you please let me know what you mean by filter 3 line to 2 line? If you are removing the respective series from the data array, then its respective legend gets removed automatically. Is it not behaving that way?… if not, can you please reproduce the behaviour in jsfiddle so that I can have a look and suggest a solution?