Legend value indexing issues

I have a dhtmlx line chart with legend values. When I click one of the them, the next graph in the addseries chart is being disabled instead of the one I selected. For Example, I have a line chart A, B and C with legend values. When I click on B instead of disabling the B chart A chart is being disabled and same is the case for others as well. Is there any indexing that I am missing?

The same works for me correctly - snippet.dhtmlx.com/d4ffdc147

Be sure that you have the same order of labels inside of “legend” as an order of series. The first item in the legend will disable first series and so on.