Javascript chart code

in node red how to create a chart javascript code

Use the Dashboard node collection.
it has built in charts - that is exposed via a dashboard URL

node-red-dashboard (node) - Node-RED (nodered.org)