
tradingview/lightweight-charts 是从 https://github.com/tradingview/lightweight-charts. 导入的 Agent Skill 候选人。
概览
tradingview/lightweight-charts 是从 https://github.com/tradingview/lightweight-charts. 导入的 Agent Skill 候选人。
概述(AI 翻译)
轻量级排行榜™
[演示][演示网址] |文档 |Reddit
TradingView 轻量级图表™是最小且速度最快的金融HTML5图表之一。
如果你想在网页上以交互式图表形式展示财务数据,或用互动图表替代静态图片图表,Lightweight Charts™ 库是最佳选择。它在不影响网页加载速度和性能的情况下实现这一点。 库的大小接近静态图片,但如果你在网页上有数十张图片图表,使用这个库可以让网页大小变小。
该库开箱即用,提供了丰富的图表功能,你也可以通过构建自定义插件来扩展功能。浏览插件目录中的现成插件,或查看交互式插件示例和plugin-examples/README.md,自行构建。
看看awesome-tradingview,了解我们社区成员创建的相关项目。
安装
ES6 通过 NPM
最新大师构建
想在不等待发布的情况下尝试最新的master版本(由pkg.pr.new提供技术支持):
以下导入和使用方法适用于两种 npm 安装选项:
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
[Demos][demo-url] | Documentation | Reddit
TradingView Lightweight Charts™ are one of the smallest and fastest financial HTML5 charts.
The Lightweight Charts™ library is the best choice for you if you want to display financial data as an interactive chart on your web page, or replace static image charts with interactive ones. It does this without affecting your web page’s loading speed and performance. The size of the library is close to static images but if you have dozens of image charts on a web page then using this library can make the size of your web page smaller.
The library provides a rich set of charting capabilities out of the box, but you can also extend its functionality by building custom plugins. Browse the plugin catalog for ready-made plugins, or see the interactive plugin examples and plugin-examples/README.md to build your own.
Take a look at awesome-tradingview for related projects created by our community members.
Installing
es6 via npm
npm install lightweight-charts
Latest master build
To try the latest master build without waiting for a release (powered by pkg.pr.new):
npm install https://pkg.pr.new/lightweight-charts@master
The import and usage below applies to both npm installation options:
import { createChart, LineSeries } from 'lightweight-charts';
const chart = createChart(document.body, { width: 400, height: 300 });
const lineSeries = chart.addSeries(LineSeries);
lineSeries.setData([
{ time: '2019-04-11', value: 80.01 },
{ time: '2019-04-12', value: 96.63 },
{ time: '2019-04-13', value: 76.64 },
{ time: '2019-04-14', value: 81.89 },
{ time: '2019-04-15', value: 74.43 },
{ time: '2019-04-16', value: 80.01 },
{ time: '2019-04-17', value: 96.63 },
{ time: '2019-04-18', value: 76.64 },
{ time: '2019-04-19', value: 81.89 },
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add tradingview/lightweight-charts