> For the complete documentation index, see [llms.txt](https://sway-technologies.gitbook.io/sway-charts-pro-scripts-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sway-technologies.gitbook.io/sway-charts-pro-scripts-documentation/sway-charts-pro-user-defined-indicators/introduction/1.3-adding-a-udi-to-a-chart.md).

# 1.3	Adding a UDI to a chart

You add a UDI to a chart – including any of the examples – by clicking on the indicators button in the chart toolbar, choosing Advanced / UDI, and then pasting in the Javascript code.&#x20;

You can also store your UDI on a web server, and then paste in the URL of the file rather than its contents. Note: your server must be CORS-friendly; your server must set the CORS headers Access-Control-Allow-Origin and Access-Control-Allow-Credentials on its response so that the chart is allowed to make the cross-origin HTTP request.

If you want to share your UDI with other people while protecting how it does its calculation, you can use a code obfuscation service. Examples include [javascript-obfuscator](https://github.com/javascript-obfuscator/javascript-obfuscator) (free) and [JScrambler](https://jscrambler.com/) (paid).
