मुख्य सामग्री पर जाएँ
Skillpedia
वेबसाइट और UI (frontend)18k · #10735

lightweight-charts

यह क्या करती है

यह स्किल AI एजेंट को Lightweight Charts लाइब्रेरी के साथ चार्ट बनाने और अपडेट करने में मदद करती है। यह उन डेवलपर्स के लिए है जो वेब ऐप में प्राइस चार्ट या समय-आधारित चार्ट बनाते हैं।

कब इस्तेमाल करें

  • ✓जब आप किसी वेब पेज में candlestick, line या histogram चार्ट जोड़ना चाहते हैं।
  • ✓जब आपको मौजूदा चार्ट में लाइव या पुराना प्राइस डेटा लगातार डालना हो।
  • ✓जब आप चार्ट में markers, tooltips, panes या रंग जोड़ना चाहते हैं।

Skill का लिंक

https://github.com/tradingview/lightweight-charts/blob/master/.github/skills/lightweight-charts/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/tradingview/lightweight-charts/blob/master/.github/skills/lightweight-charts/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“क्या आप दिखा सकते हैं कि Lightweight Charts से लाइव प्राइस अपडेट के साथ candlestick चार्ट कैसे जोड़ें?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट पहले जाँचता है कि आपका प्रोजेक्ट लाइब्रेरी का कौन-सा वर्शन इस्तेमाल करता है, फिर उसके typings पढ़ता है और सही विकल्प नामों के साथ कोड लिखता है। जो method मौजूद नहीं हैं, उन्हें वह अंदाज़े से नहीं लगाता।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Lightweight Charts skill

Works the same whether the project is a downstream npm consumer app or an upstream lightweight-charts source checkout. Detect which one you are in (below) and resolve every API name from whatever typings are locally available.

Source lookup order

Do not assume you are inside the upstream source repository.

  1. In a consumer app, inspect the installed package first:
    • node_modules/lightweight-charts/package.json for the actual version.
    • node_modules/lightweight-charts/dist/typings.d.ts for the API surface.
  2. In the upstream repo, inspect dist/typings.d.ts first, then src/ if generated output is unavailable.
  3. Use official docs/examples as supporting evidence, but local typings win when they disagree.

Verify before answering (copy-paste):

node -p "require('./node_modules/lightweight-charts/package.json').version"
rg -n "createSeriesMarkers|addSeries|IPrimitivePaneRenderer|createImageWatermark|createOptionsChart" node_modules/lightweight-charts/dist/typings.d.ts
# upstream checkout instead of a consumer app:
rg -n "createSeriesMarkers|IPrimitivePaneRenderer|createImageWatermark|createOptionsChart" dist/typings.d.ts src

If the relevant file is unavailable, say what could not be verified. Do not invent option names, methods, exports, or wrapper behavior.

If the user's code imports from lightweight_charts import ... (underscore), uses pandas/asyncio, or talks about a Python window wrapper, they are probably using the third-party Python wrapper rather than the TypeScript package. Say that clearly before giving core lightweight-charts v5 JavaScript advice.

Mental model

Eight layers, in dependency order. Most bugs come from confusing one for another:

  1. Chart — createChart(container, options) returns an IChartApi. One chart per container element.
  2. Series — added via chart.addSeries(SeriesType, options, paneIndex?). Each call returns an ISeriesApi. v5 requires importing the series type explicitly.
  3. Scales — chart.timeScale() (ITimeScaleApi), chart.priceScale(id) (IPriceScaleApi). Govern range, ticks, autoscale, visibility.
  4. Data model — arrays of { time, … } points. Time = UTCTimestamp | BusinessDay | string. UTCTimestamp is seconds, not milliseconds. Times must be unique and ascending per series.
  5. Interaction — chart.subscribeCrosshairMove, chart.subscribeClick, timeScale.subscribeVisibleLogicalRangeChange, etc.
  6. Layout — chart.panes(), chart.addPane(). Adding a series with an out-of-range paneIndex auto-creates the pane.
  7. Extension — pane primitives, series primitives, custom series, watermarks, custom renderers (canvas via fancy-canvas).
  8. Wrappers — React/Vue/Web Components/iOS/Android. Lifecycle is the wrapper's responsibility; the core library is framework-agnostic.

v5 essentials

The conventions that catch people copying older snippets:

import { createChart, CandlestickSeries, LineSeries } from 'lightweight-charts';

const chart = createChart(container, { /* ChartOptions */ });
const candles = chart.addSeries(CandlestickSeries, { /* options */ });
candles.setData([
    { time: 1700000000, open: 1, high: 2, low: 0.5, close: 1.5 },
]);

Key v5 changes versus older snippets:

  • chart.addSeries(SeriesType, options, paneIndex?) replaces addLineSeries / addCandlestickSeries / …
  • createSeriesMarkers(series, markers) replaces series.setMarkers(...). The returned primitive owns .setMarkers(...) / .markers().
  • createTextWatermark(pane, options) and createImageWatermark(pane, imageUrl, options) replace the watermark chart option.
  • Series types are tree-shaken — importing them is required for ESM.

If a snippet calls addLineSeries or series.setMarkers, it's v4 or older. Confirm the user's version before forwarding it.

When the task targets v5, show the v5 API directly — do not hedge by mixing in v4 syntax.

Triage (problem → API → avoid)

User asks about First check Answer with Avoid
v5 series creation package version + typings chart.addSeries(SeriesType, options) addLineSeries / addCandlestickSeries
markers createSeriesMarkers export marker primitive + required color series.setMarkers
timezone formatter need vs data semantics Intl.DateTimeFormat in formatters fake timeScale.timezone
realtime updates last-bar vs full replace series.update(point)
अक्सर पूछे जाने वाले सवाल

क्या एजेंट को प्रोजेक्ट में लाइब्रेरी इंस्टॉल चाहिए?

यह सबसे अच्छा काम करता है जब लाइब्रेरी इंस्टॉल हो, क्योंकि तब वह सटीक वर्शन और typings पढ़ सकता है। ज़रूरत पड़ने पर वह आधिकारिक दस्तावेज़ भी इस्तेमाल कर सकता है।

क्या यह React या Vue के wrappers में मदद कर सकता है?

हाँ। स्किल उन फ़्रेमवर्क के wrapper विकल्पों को भी कवर करती है।

अगर एजेंट किसी बात की पुष्टि न कर पाए तो?

वह बताता है कि उसने किस बात की जाँच नहीं की, ताकि आप खुद उसे परख सकें।

जानकारी

लेखक का मूल विवरण

Use when working with TradingView's lightweight-charts — creating charts, adding series (Line/Area/Bar/Candlestick/Histogram), configuring time and price scales, streaming realtime or historical data, panes, markers, per-bar/per-point colors, tooltips, coordinate conversion, custom plugins or primitives, non-financial horizontal scales, SSR/browser loading, or React/Vue/Web Components wrappers. Covers v5 API conventions and the common time, scale, marker, plugin, and wrapper foot-guns.

repo: tradingview/lightweight-charts

लोकप्रियता

GitHub स्टार
18k
रैंकिंग में स्थान
#10735
लाइसेंस
Apache-2.0
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills