fixed chart to table function