rewrite charting api
updated js api