Adding configuration to hide entries in the chart legend if there is no value for them at the selected index