# Lumen Charts documentation

Public integration documentation for a proprietary library. Runtime access is separately authorized. Exported API signatures do not imply that all legacy capabilities are supported; preserve compatibility notes when using these documents.

<!-- Public documentation export; not library implementation source. -->
# Events, history and advanced APIs

Subscribe to events to follow what the chart is doing, and use commands to change it. Keep the chart's internal objects out of your code.

## Subscriptions

For every `widget.subscribe(event, callback)`, call `unsubscribe` later with the same callback. Chart subscription handles take the documented owner and callback arguments. Keep a list of what to clean up, and unsubscribe when the chart or component goes away.

## Screenshots

Use the public screenshot API, and check what it actually returns. Uploading screenshots to a server needs a service you set up. Capturing the canvas doesn't give you a shareable URL by itself. Images from other origins can also stop the canvas from being exported.

## History checkpoints

The optional history command API lets you export and restore a versioned checkpoint of the chart's undo history. This is separate from saving the chart itself. Checkpoints have limits on the number of actions and their size, and they may stop at an action that isn't supported. Restore the saved chart first, then check that the chart's identity and current state match before you restore its history.

## Automation SDK

Use the optional [automation SDK](https://docs.lumencharts.com/charting-library/automation/) for typed command sessions, bounded local data, PNG capture and custom extensions. Native command owners require explicit add-on loading. Model providers, uploads and remote persistence remain host integrations.

## External command interfaces

The workspace, drawing, study and history command factories tell your app which commands are available. They need a stable link to a specific chart and versioned inputs. The internal worker protocol and the Nuxt app's own services aren't general browser APIs, so don't build on them.

## Performance

Measure startup, interaction and cleanup in your real app. Keep history requests to a reasonable size, don't rebuild charts when unrelated UI state changes, and release subscriptions. Good performance with sample data doesn't guarantee the same with every real market dataset.

[Public API index](https://docs.lumencharts.com/charting-library/api/)

---
Documentation page: https://docs.lumencharts.com/charting-library/reference/events


---

<!-- Public documentation export; not library implementation source. -->
# Compatibility and supported scope

The runtime covers real, everyday charting workflows, and its browser namespace is `LumenChartingLibrary`. This page explains how to tell what's supported.

## Reading the API reference

The API reference sorts types into three kinds:

- Facades the runtime actually implements.
- Interfaces that your app implements.
- Types that exist only in the declarations for compatibility.

A signature in a declaration file doesn't mean there's a broker connection, an external cloud service or a full indicator catalog behind it.

To see what your loaded runtime supports, call `widget.getAllFeatures()`, `widget.supportedChartTypes()` and `widget.getStudiesList()`. The catalogs in these docs list the tools and indicators the runtime includes. If someone passes an unsupported input, treat it as an error. Don't quietly swap in a different feature.

## Who handles what

| Capability | Handled by |
| --- | --- |
| Historical and realtime bars | Your datafeed |
| Chart rendering and supported tools | The chart runtime |
| Layout storage and access control | Your adapter and backend |
| Order ticket, account manager and on-chart orders | The trading runtime, after `loadTrading()` |
| Placing broker orders | Your broker adapter (drawings and annotations don't place orders) |
| Pine worker and editor | Optional assets that you turn on |
| Pine cloud publishing and alerts | Providers you configure (drawing Pine locally is not cloud delivery) |
| Layouts saved by other chart libraries | Not guaranteed to work with this runtime's formats |

## Release identity

The legacy `version()` string tells you which version line the runtime is compatible with. To identify the exact files you shipped, use the manifest digest shown on the [releases](https://docs.lumencharts.com/charting-library/reference/releases) page. Always ship the wrapper, iframe, styles and worker together.

The demo uses sample data and stores things in your browser only. It makes no promises about market data uptime, financial accuracy or saving to a server.

---
Documentation page: https://docs.lumencharts.com/charting-library/reference/compatibility


---

<!-- Public documentation export; not library implementation source. -->
# Releases and upgrading

These docs are built against one verified chart release. Its build ID appears above each article and matches the compiled runtime the demo uses.

## Compatibility version versus build ID

The public `version()` string tells you which version line the runtime is compatible with. The SHA-256 runtime manifest identifies the exact wrapper, iframe, styles and optional Pine files served here. When you report a problem or compare deployments, use the manifest.

## About this documentation release

This first release adds the integration guides, the public API reference, a demo that behaves the same every time, and replaceable local images. It doesn't change how the chart language works, and it doesn't introduce a new universal compatibility version.

There's only one runtime release for now, so there's no versions menu. As more supported runtime releases come out, their docs should keep stable URLs and include clear upgrade notes.

## Upgrade safely

Upgrade the runtime, declarations, docs and optional files together as one release.

1. Read the new release's compatibility and schema changes.
2. Test your symbol metadata and your historical and realtime sample data.
3. Test drawings, indicators and a sample of real saved layouts and templates.
4. Try mounting, unmounting, reconnecting and failed save/load operations.
5. Check every deployed file against the new release's manifest.
6. Ship the whole release, and keep the previous one ready for rollback.

### Don't mix versions

A new wrapper with an old inner runtime or Pine worker can fail during startup or when the two talk to each other. Versioned paths that never change prevent old and new files from mixing in caches. To roll back, restore the whole release, not just one JavaScript file.

### Saved state

Keep provider and schema namespaces clearly separate. Reject saved data that isn't compatible, and never quietly drop parts of it. An older release may not be able to read data saved in a newer schema, so keep backups before any migration.

[Schema policy](https://docs.lumencharts.com/charting-library/persistence/migration)

---
Documentation page: https://docs.lumencharts.com/charting-library/reference/releases


---

<!-- Public documentation export; not library implementation source. -->
# Troubleshooting and support

Start with your browser's console and Network panel. First work out where things went wrong: the host container, loading the runtime files, the datafeed, an indicator, or saving and loading.

| What you see | What to check | How to fix it |
| --- | --- | --- |
| Blank chart | Container height and runtime script requests | Give the parent a height, and fix `library_path` |
| HTML comes back instead of JS | Your static host's fallback page | Serve the right file and MIME type, or a real 404 |
| Chart never becomes ready | Script errors, CSP, missing iframe files | Fix the resource that's failing, then retry from a clean start |
| Chart is ready but has no candles | `resolveSymbol` and `getBars` callbacks | Make sure every request ends in success or error, and check time units |
| Bars show up in 1970 or far in the future | Seconds mixed up with milliseconds | Convert at the documented point in your datafeed |
| Duplicate bars | Timestamp order and realtime update rules | Return unique, ascending history, and only update the latest bar in realtime |
| Too few bars | `countBack`, sessions and provider paging | Fetch earlier history, or report that there's genuinely no more |
| Old symbol shows up after switching | Late responses from earlier requests | Ignore responses from older requests, and unsubscribe |
| No Save/Load controls | Incomplete adapter | Implement all four layout methods |
| Saved layout is rejected | Schema or provider mismatch | Load a supported schema that matches, and keep the current chart as it is |
| Pine isn't available | Feature flag and worker/editor files | Ship the matching optional files and turn on the configuration |
| Chart keeps running after navigation | Your timers and subscriptions | Remove the widget and everything your code started |

## Try it with sample data

Open the [demo](https://docs.lumencharts.com/demo/). If the sample works but your provider doesn't, compare your symbol metadata, timestamps and callback order with the sample. If both fail, look at the runtime file requests and the browser environment.

## Glossary

| Term | Meaning |
| --- | --- |
| Widget | The chart container your app creates, and its public API |
| Chart | One chart inside a widget or layout |
| Datafeed | The callbacks your app provides for symbols and market data |
| Bar | One OHLCV data point, with a timestamp in epoch milliseconds |
| Resolution | How much time one bar covers, such as `15` or `1D` |
| Pane | One of the stacked plot areas in a chart, holding series or indicators |
| Study | An indicator or calculation added to a chart |
| Drawing | An interactive analysis shape with its own source ID |
| Layout | A saved chart or workspace setup |
| Template | A reusable set of style or indicator settings |
| Manifest | The list of runtime files and their cryptographic hashes |
| Runtime build ID | The start of this release manifest's hash |
| Capability | A feature that's fully set up and supported end to end |
| Provider | Code in your app that supplies data or external services |

## Integration support

Use the support channel that came with your chart distribution. These docs don't assume you can see the source repository or any internal issue tracker.

### Make the problem easy to reproduce

Note the runtime manifest ID from [releases](https://docs.lumencharts.com/charting-library/reference/releases), your browser and its version, your app's base path, and the smallest set of steps that shows the problem. Where you can, swap real market or account data for a small set of sample data.

Describe what you expected and what actually happened. Include console and network errors with sensitive details removed. Let us know whether the [interactive demo](https://docs.lumencharts.com/demo/) shows the same issue.

### Before you share

Remove API keys, session tokens, account IDs and private scripts. Keep the relevant symbol metadata and timestamps so the datafeed calls can be checked. Screenshots help, but they can't replace a sequence of callbacks that reproduces the problem.

---
Documentation page: https://docs.lumencharts.com/charting-library/reference/troubleshooting
