Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomDatafeed 能不能给一个列子? #35

Open
rjzou opened this issue Mar 11, 2024 · 4 comments
Open

CustomDatafeed 能不能给一个列子? #35

rjzou opened this issue Mar 11, 2024 · 4 comments

Comments

@rjzou
Copy link

rjzou commented Mar 11, 2024

还有你 这个库要怎么用呢?

@liihuu
Copy link
Member

liihuu commented Mar 11, 2024

@liihuu
Copy link
Member

liihuu commented Mar 11, 2024

@rjzou
Copy link
Author

rjzou commented Mar 12, 2024

按照你上面的方法写了之后,
1.git clone 你的代码
2.增加CustomDatafeed 文件
3.执行 npm run build
4.生成了对应的js 文件klinecharts-pro.umd.js,klinecharts-pro.js

在html页面

`

<script src="klinecharts-pro.umd.js"></script>

<link rel="stylesheet" href="klinecharts-pro.css" />
<script>
    // 创建实例
    const chart = new klinechartspro.KLineChartPro({
        container: document.getElementById('container'),
        datafeed: new klinechartspro.CustomDatafeed()
    })
</script>

`

直接报错啊
CustomDatafeed.ts:90 Uncaught TypeError: Cannot read properties of undefined (reading 'registerOverlay')
Uncaught TypeError: klinechartspro.CustomDatafeed is not a constructor

@rjzou
Copy link
Author

rjzou commented Mar 12, 2024

image

这是typescript 语法,要怎么在项目中用呢?

使用tsc 文件名,生成的js

image

没有办法在html 引用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants