Skip to content
Discussion options

You must be logged in to vote

Yes, you can add HTML buttons to panes in Lightweight Charts by manipulating the DOM directly:

  1. Each pane is rendered as a table row (<tr>) within a table inside the container div. You can append custom HTML elements to these rows using standard DOM APIs.

  2. For proper positioning:

    • Set position: absolute and z-index: 100 (some number large enough to stack on top) on your button elements
    • Set position: relative on the parent <tr> elements to establish positioning context

For detecting pane resizes, Lightweight Charts doesn't provide direct callbacks for individual pane resizing. However, you can:

  1. Implement a MutationObserver to watch for DOM changes on the pane elements. However you co…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@vishnuc
Comment options

Answer selected by SlicedSilver
Comment options

You must be logged in to vote
1 reply
@SlicedSilver
Comment options

Comment options

You must be logged in to vote
1 reply
@SlicedSilver
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1857 on April 09, 2025 14:07.