lightweight-charts
lightweight-charts copied to clipboard
Timescale-based markers
In #24 we'll implement series-based markers (attached to series), but it would be awesome to have markers right above timeaxis. Also, these markers might be "in the future" (extend time scale).
See comments:
- https://github.com/tradingview/lightweight-charts/issues/24#issuecomment-511904914
- https://github.com/tradingview/lightweight-charts/issues/24#issuecomment-511949905
- https://github.com/tradingview/lightweight-charts/issues/24#issuecomment-512041090
- https://github.com/tradingview/lightweight-charts/issues/24#issuecomment-512154205
Related issue #127
Specifies where in the bounding box of the marker the (x, y) point should be. Examples: Giving [0, 0] would mean top-left, [1, 0] would mean bottom-left, [0, 1] would mean bottom-right, [0, 0.5] would mean top-center, and giving [0.5, 0.5] would mean center-center
@andresberrios "top-left"/"bottom-left"/"bottom-right"/"top-center"/"center-center" of what? We just provide a price and time where event is happened. In this case I can imagine only horizontal align because of bar spacing.
What I meant there is illustrated in this image:
It indicates where in the rectangle that encloses the image/marker you want the point (time, price) of the chart to be anchored. The default would normally be [0.5, 0.5]
so the marker would appear with its center-center on top of the point, which is what you normally would want if you are using a circle or a dot as marker, for example.
It doesn't necessarily have to be done this way, but this would allow for the maximum flexibility and customization.
@andresberrios has a good point on asking this,
for a candle, histogram and bar series would have a width that would require the [0,0.5]
a line, area series point has no width and would be [0,0]
@bmatusiak
a line, area series point has no width and would be
[0,0]
I think what you mean is [0.5, 0.5]
for it to be centered on top of the point with no width, if I'm understanding you correctly.
Thank you for your feature request for Lightweight Charts. In order to keep the library lightweight and maintain a narrow focus, we strive to include only strictly required features in the core library. As a result, we have decided that this requested feature should be implemented as a plugin instead, and will be closing this issue as a result.
We recently introduced the ability to write plugins for Lightweight Charts, allowing users like you to extend the functionality of the library without adding it to the core. We highly recommend implementing your feature request as a plugin to achieve the desired functionality while keeping the core bundle size smaller for all users.
To get started with plugins, please refer to our Plugins Documentation for a better understanding of what is possible and how plugins work. You can also explore our collection of plugin examples (with a preview hosted here) for inspiration and guidance on implementing specific functionality.
To help you get started quickly, we have created an NPM package called create-lwc-plugin, which sets up a plugin project for you. This way, you can hit the ground running with your plugin development.
If you do create a plugin based on your feature request, we would appreciate it if you could publish it on GitHub or NPM and let us know. This way, we can share it with the rest of the community. It would be helpful if you could prefix your NPM package name with lwc-plugin-
for easier discoverability by others.
Thank you for your understanding and support. We believe implementing your feature request as a plugin will greatly benefit both you and the Lightweight Charts community.