js script for charts