If you have many lines on a graph, it’s hard to distinguish between them. Sometimes you can group them into categories and color them by categories, but often the answer is to use a small multiples chart or a different kind of graph.

@alangwilson on the d3 slack has these rules for line graphs and colors. He advises to use fewer than 5-7 groups of lines or less than 5 if there are many instances drawn together. In this case, draw a small multiples chart with each category in a separate chart but aligned with the other charts for comparison.
https://bl.ocks.org/mbostock/1157787
https://bl.ocks.org/pstuffa/fbf893deff6661f7402846b41457ebcb