tradingview / lightweight-charts

Performant financial charts built with HTML5 canvas
https://www.tradingview.com/lightweight-charts/
Apache License 2.0
9.23k stars 1.59k forks source link

Adding support for images as markers #694

Closed PwnPeter closed 12 months ago

PwnPeter commented 3 years ago

Hi ! Just a small idea that could be very useful to customize your own markers would be to be able to define an image in addition to the available shapes.

thanhlmm commented 3 years ago

For more customization, I think it should work something like we're doing with tooltip. Subscribe to the event if the marker is available for showing -> give dev with position, status,... then they're free to display what ever he want

lauris commented 3 years ago

This and more flexibility for custom styling of lines/markers/labels would be highly appreciated.

timocov commented 3 years ago

Don't forget to put your 👍 to the first message 😉

thanhlmm commented 3 years ago

I intend to do this by subscribing to time range change and draw it by html/CSS. Currently, I don't see any more benefit if the chart support it natively like what we're doing with tooltip

zouxuoz commented 2 years ago

It would be great addition

zouxuoz commented 2 years ago

@timocov can I help with implementation?

SlicedSilver commented 12 months ago

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.

For your particular feature request, we suggest taking a look at the following examples (see above links):

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.

m0rtyn commented 11 months ago

You guys are having a name collision for the lwc-plugin prefix. There is the Lightning Web Components from Saleforce. This makes it difficult to find other ready-made plugins for your chart.

image

SlicedSilver commented 11 months ago

Most of those search results are plugin-lwc or lwc-*-plugin which aren't an exact match for the prefix of lwc-plugin-*.

Checking the keyword on NPM, shows only lightweight chart plugins (they are new so there is only 1 so far...): https://www.npmjs.com/search?q=keywords:lwc-plugin

We could think about using lwchart-plugin- or lw-chart-plugin- instead as that appears to be more unique.

So in summary, lwc-plugin- prefix does appear to be unique, but fuzzy searching will include results for packages with similar names.