Fix for chart in detail page and refactoring of script.