Installations
npm install lightweight-charts
Developer Guide
Typescript
No
Module System
CommonJS, ESM
Node Version
18.19.1
NPM Version
10.2.4
Score
99.6
Supply Chain
98.9
Quality
94.2
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Languages
TypeScript (46.15%)
JavaScript (31.74%)
HTML (12.88%)
MDX (7.18%)
CSS (1.48%)
Vue (0.43%)
Shell (0.14%)
Developer
Download Statistics
Total Downloads
9,596,777
Last Day
7,582
Last Week
82,116
Last Month
468,141
Last Year
4,358,497
GitHub Statistics
10,118 Stars
2,535 Commits
1,679 Forks
163 Watching
24 Branches
51 Contributors
Bundle Size
159.81 kB
Minified
49.87 kB
Minified + Gzipped
Package Meta Information
Latest Version
4.2.2
Package Id
lightweight-charts@4.2.2
Unpacked Size
3.07 MB
Size
625.88 kB
File Count
13
NPM Version
10.2.4
Node Version
18.19.1
Publised On
06 Dec 2024
Total Downloads
Cumulative downloads
Total Downloads
9,596,777
Last day
-64.8%
7,582
Compared to previous day
Last week
-26.2%
82,116
Compared to previous week
Last month
8.5%
468,141
Compared to previous month
Last year
65.7%
4,358,497
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Demos | Documentation | Discord community | 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 without affecting your web page loading speed and performance.
It is the best choice for you if you want to replace static image charts with interactive ones. 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.
Installing
es6 via npm
1npm install lightweight-charts
1import { createChart } from 'lightweight-charts'; 2 3const chart = createChart(document.body, { width: 400, height: 300 }); 4const lineSeries = chart.addLineSeries(); 5lineSeries.setData([ 6 { time: '2019-04-11', value: 80.01 }, 7 { time: '2019-04-12', value: 96.63 }, 8 { time: '2019-04-13', value: 76.64 }, 9 { time: '2019-04-14', value: 81.89 }, 10 { time: '2019-04-15', value: 74.43 }, 11 { time: '2019-04-16', value: 80.01 }, 12 { time: '2019-04-17', value: 96.63 }, 13 { time: '2019-04-18', value: 76.64 }, 14 { time: '2019-04-19', value: 81.89 }, 15 { time: '2019-04-20', value: 74.43 }, 16]);
CDN
You can use unpkg:
https://unpkg.com/lightweight-charts/dist/lightweight-charts.standalone.production.js
The standalone version creates window.LightweightCharts
object with all exports from esm
version:
1const chart = LightweightCharts.createChart(document.body, { width: 400, height: 300 }); 2const lineSeries = chart.addLineSeries(); 3lineSeries.setData([ 4 { time: '2019-04-11', value: 80.01 }, 5 { time: '2019-04-12', value: 96.63 }, 6 { time: '2019-04-13', value: 76.64 }, 7 { time: '2019-04-14', value: 81.89 }, 8 { time: '2019-04-15', value: 74.43 }, 9 { time: '2019-04-16', value: 80.01 }, 10 { time: '2019-04-17', value: 96.63 }, 11 { time: '2019-04-18', value: 76.64 }, 12 { time: '2019-04-19', value: 81.89 }, 13 { time: '2019-04-20', value: 74.43 }, 14]);
Build Variants
Dependencies included | Mode | ES module | CommonJS ⚠️ | IIFE (window.LightweightCharts ) |
---|---|---|---|---|
No | PROD | lightweight-charts.production.mjs | lightweight-charts.production.cjs | N/A |
No | DEV | lightweight-charts.development.mjs | lightweight-charts.development.cjs | N/A |
Yes (standalone) | PROD | lightweight-charts.standalone.production.mjs | - | lightweight-charts.standalone.production.js |
Yes (standalone) | DEV | lightweight-charts.standalone.development.mjs | - | lightweight-charts.standalone.development.js |
⚠️ Deprecation note: CommonJS support will be removed from the library at the start of 2024.
Development
See BUILDING.md for instructions on how to build lightweight-charts
from source.
License
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at LICENSE file. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This software incorporates several parts of tslib (https://github.com/Microsoft/tslib, (c) Microsoft Corporation) that are covered by BSD Zero Clause License.
This license requires specifying TradingView as the product creator.
You shall add the "attribution notice" from the NOTICE file and a link to https://www.tradingview.com/ to the page of your website or mobile application that is available to your users.
As thanks for creating this product, we'd be grateful if you add it in a prominent place.
You can use the attributionLogo
chart option for displaying an appropriate link to https://www.tradingview.com/ on the chart itself, which will satisfy the link requirement.
No vulnerabilities found.
Reason
21 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/deploy.yml:1
- Info: no jobLevel write permissions found
Reason
Found 7/19 approved changesets -- score normalized to 3
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/tradingview/lightweight-charts/deploy.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/tradingview/lightweight-charts/deploy.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/deploy.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/tradingview/lightweight-charts/deploy.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: scripts/check-dts-changes.sh:23
- Warn: npmCommand not pinned by hash: scripts/run-graphics-tests.sh:22
- Warn: npmCommand not pinned by hash: scripts/run-graphics-tests.sh:29
- Warn: npmCommand not pinned by hash: .github/workflows/deploy.yml:32
- Warn: npmCommand not pinned by hash: .github/workflows/deploy.yml:37
- Warn: npmCommand not pinned by hash: .github/workflows/deploy.yml:43
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
- Info: 0 out of 6 npmCommand dependencies pinned
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 19 are checked with a SAST tool
Score
6.1
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More