Optimize a little bit graph panel js