Closed MuslemRahimi closed 1 year ago
const price = param.seriesPrices.get(lineLegend);
seriesPrices
was removed in lightweight-charts@4.0.0 and svelte-lightweight-charts@2.0.0
You should use seriesData
in the new version. Look at the demo: https://svelte.dev/repl/1b431bf3d75948769855d14c55bbc5f7
What version of svelte-lightweight-charts
are you using?
Also you need to store series referencies in different variables.
<LineSeries data={data1}
color="#d4d9d9"
lineWidth={1.5}
priceScaleId="right"
crosshairMarkerVisible={false}
priceLineVisible= {false}
ref={(ref) => series1 = ref}
/>
<LineSeries data={data2}
color="#A09D00"
lineWidth={1.5}
priceScaleId="right"
crosshairMarkerVisible={false}
priceLineVisible= {false}
ref={(ref) => series2 = ref}
/>
Then you will be able to get prices for each series using:
const { value: price1 } = param.seriesData.get(series1);
const { value: price2 } = param.seriesData.get(series2);
Or If you are using older version:
const price1 = param.seriesPrices.get(series1);
const price2 = param.seriesPrices.get(series2);
thank you very much. Now I understand it
Hi,
I have this issue that the price of the first LineSeries is not shown when i go over with the mouse but for the second LineSeries it works.
Here is an example code to reproduce my problem: