Is it possible to add priceline dynamically?
kayazinc opened this issue · comments
For example, in javascript, we can add priceline dynamically by:
const candlestickSeries = chart.addCandlesticksSeries({...}}
candlestickSeries.createPriceLine({...})
From the examples in project, it seem the pricelines are predefined. Is there anyways to add new priceline dynamically when there is an event window.addListener(...)?
I found the solution by using the ref api attached to the series.
<CandlestickSeries
data={barSeries}
reactive={true}
ref={(api) => { barSeries = api }}
...
barSeries.createPriceLine({...})
Thank you.
Yes, it is possible! Just add <PriceLine>
component inside your series component.
Check my example https://svelte.dev/repl/3294790e6b5048a5abfb3d239405214b.
Yes, it is possible! Just add
<PriceLine>
component inside your series component.Check my example https://svelte.dev/repl/3294790e6b5048a5abfb3d239405214b.
Thank, your solution is simpler and cleaner!