How can i change the legend of a chart based on the value of a cell?

Thanks
Varun