Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow AREA series to be "infinite" horizontally ( like price lines ) #1669

Open
0x33dm opened this issue Aug 1, 2024 · 3 comments
Open

Allow AREA series to be "infinite" horizontally ( like price lines ) #1669

0x33dm opened this issue Aug 1, 2024 · 3 comments

Comments

@0x33dm
Copy link

0x33dm commented Aug 1, 2024

Currently, the "PRICE LINE" is infinite on the chart, and it works perfectly.

Along with the 2 price lines i have i added an AREA series in order to "paint" it with a "rectangle", i would like it to be "infinite horizontally" the same way as the price lines.

So there would be no "gap" on the sides when using "rightOffset"

Is it possible?

image

@SlicedSilver
Copy link
Contributor

I would suggest that you could implement this with a LWC plugin.

Plugins would allow you to define a rectangle that drawn completely across the screen.

The template example provided by create-lwc-plugin for a drawing primitive is a rectangle, and then you could add in some options to draw a gradient for the fill, and remove the logic for defining x coordinates and rather just plot from 0 until scope.mediaSize.width * scope.horizontalPixelRatio in the renderer code.

@0x33dm
Copy link
Author

0x33dm commented Aug 6, 2024

I would suggest that you could implement this with a LWC plugin.

Plugins would allow you to define a rectangle that drawn completely across the screen.

The template example provided by create-lwc-plugin for a drawing primitive is a rectangle, and then you could add in some options to draw a gradient for the fill, and remove the logic for defining x coordinates and rather just plot from 0 until scope.mediaSize.width * scope.horizontalPixelRatio in the renderer code.

The tricky part is that the rectangle would have to work like the area, as in, when the chart is resized and moved around, the rectangle would also have to resize and move around.

I remember seeing a list of plugins somewhere, I would assume if there is a plugin system than something like that is probably already done ( i.e. drawing shapes on the chart that resizes / adapts like the the price line and the area chart )

@safaritrader
Copy link

I would suggest that you could implement this with a LWC plugin.

Plugins would allow you to define a rectangle that drawn completely across the screen.
The template example provided by create-lwc-plugin for a drawing primitive is a rectangle, and then you could add in some options to draw a gradient for the fill, and remove the logic for defining x coordinates and rather just plot from 0 until scope.mediaSize.width * scope.horizontalPixelRatio in the renderer code.

The tricky part is that the rectangle would have to work like the area, as in, when the chart is resized and moved around, the rectangle would also have to resize and move around.

I remember seeing a list of plugins somewhere, I would assume if there is a plugin system than something like that is probably already done ( i.e. drawing shapes on the chart that resizes / adapts like the the price line and the area chart )

im creating a full pure js plugin for lightweight chart. you can check this :
https://github.com/safaritrader/lightweight-chart-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants