# LightweightCharts is not defined

**URL:** <https://community.bitquery.io/t/lightweightcharts-is-not-defined/1042>\
**Category:** GraphQL Tutorials\
**Tags:** tradingview\
**Created:** [May 20, 2022, 5:54pm UTC](https://community.bitquery.io/t/lightweightcharts-is-not-defined/1042 "2022-05-20T17:54:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![three](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/three/32/752_2.png) [@three](https://community.bitquery.io/u/three)\
**Post date:** [May 20, 2022, 5:54pm UTC](https://community.bitquery.io/t/lightweightcharts-is-not-defined/1042/1 "2022-05-20T17:54:43Z")

</div>

Hello! First time posting any sort of tutorial so please excuse the formatting.

Earlier I was running into an issue where a TradingView widget I embedded on my site was not loading on the page. After some messing around I was able to work around the issue and was told to share the solution here just in case anybody else ran into this.

 ![Screen Shot 2022-05-20 at 12.42.00 PM](https://us1.discourse-cdn.com/flex016/uploads/bitquery/original/1X/3d13f0651f50c8c121ed7cf99c6018302aceb65c.png)  
I was able to get my code to work on JSbin so I figured the issue had something to do with my server. I eventually noticed this error in the console. So chances are if you’re having the same issue and are seeing this same error the problem has to do with the lightweight charts library not being loaded.

I still am not 100% sure why this was happening but I was able to fix it by downloading the lightweight charts library, adding it to my server, and then replacing:

```auto
<script src="https://unpkg.com/lightweight-charts/dist/lightweight-charts.standalone.production.js"></script>

```

with:

```auto
<script src="/assets/js/lightweight-charts.js"></script>

```

Hope this helps somebody!

---

<div class="post-metadata">

**Author:** ![sayon-bitquery](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/sayon-bitquery/32/522_2.png) [@sayon-bitquery](https://community.bitquery.io/u/sayon-bitquery)\
**Post date:** [May 21, 2022, 7:00am UTC](https://community.bitquery.io/t/lightweightcharts-is-not-defined/1042/2 "2022-05-21T07:00:13Z")

</div>

Implement the Lightweight charting widget with Bitquery GraphQL API

> [@TradingView Charts integration with Bitquery APIs (Lightweight Charting)](https://community.bitquery.io/t/tradingview-charts-integration-with-bitquery-apis-lightweight-charting/211):
>
> In this article, we will be integrating Bitquery’s GraphQL API with TradingView’s Lightweight charting library. TradingView provides more than 50 different features for data analysis through its interactive charts and highly scalable platform. The Lightweight Charting Library is the best choice for you if you want to display financial data as an interactive chart on your web page without affecting your web page loading speed and performance. Sign up to [Bitquery.io](http://Bitquery.io) If you are new to Bitquery’s…
