Moved a logic getting options of chart to charts.py.