Skip to content

Custom date/time label below current price (like TradingView) #1992

@biennguyen13

Description

@biennguyen13

I’m building a candlestick chart using Lightweight Charts and updating the current candle price in real time.

However, I’d like to display the date/time of the current candle below the price label, similar to how TradingView shows it — but currently, there’s no clear way to do that.

I’ve tried:
• Exploring the new plugin/primitive API (Lightweight Charts Next), but couldn’t find a way to draw a label below the price.
• Creating a new LineSeries with:
priceFormat: { type: 'custom', formatter: (price: number) => { return new Date(); }, }, but it didn’t have any effect.

It would be great to have a way (via plugin, primitive, or built-in API) to render a custom label below the current price, showing the corresponding date/time of the candle — just like TradingView does.

Here’s a screenshot example from TradingView showing what I mean:

Image

And this is my demo:

Image

Can anyone help me achieve this? I’d really appreciate any hint or example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions