You may customize the "X" button by creating it in HTML, using "%closeScript" as the place holder for the Javascript that closes the window.
As an example, the default "X" button is:
[<a href="javascript:%closeScript"> X </a>]
Note: This is a static property (class property). It should be accessed as JsChartViewer.xButton, not objName.xButton.