info_selected() is complete; chart_selected() still needs to be written.
Simplified the code that info_range() and chart_range() use to pass the data to the appropriate function.