[search] Extracted charting to external js file