The original example is interactive, and the legend is really a "selector" to include or exclude categories. Colors may be…