-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Markers doesn't show and disappears on Chrome/Chromium browsers. #534
Comments
Do you a jsfiddle-repro for that? Meanwhile, please check that all your markers are sorted in asc order by time. |
@timocov yep, they are sorted in ascending order by time. It's all good on firefox. |
Can you try to do the following:
|
Okie, to answer #2 the format I use is just the epoch timestamp of the candle for the shapes. |
I'm having the same issue. Some markers disappear when zoomed in or panned to a certain area, despite still being in range and should/would be drawn. Edit: Upon further investigation, it seems to be related to sorting for sure. // This works as expected
candleSeriesRef.current.setMarkers(
[...byTimestampAndType.sells, ...byTimestampAndType.buys].sort((a, b) => a.time - b.time),
);
// This is broken as described
candleSeriesRef.current.setMarkers(
[...byTimestampAndType.sells, ...byTimestampAndType.buys].sort((a, b) => b.time - a.time),
);
// This is broken as described
candleSeriesRef.current.setMarkers(
[...byTimestampAndType.sells, ...byTimestampAndType.buys],
); So they simply should be sorted. |
Yes, I ran into the same issue (both Chrome and Firefox) and sorting the array helped.
https://github.com/tradingview/lightweight-charts/blob/master/docs/series-basics.md#setmarkers It could be a feature request for the library to sort it automatically internally, so it's not a user's responsibility. |
@kovalu Sorting array might affect performance, and if you pass a huge sorted array, it might take some time for no reason. A user must sort it before pass it to the library, because it's a requirement of the library (which is declared in the docs as well). We'll warn about that in #315 in debug mode only, so it won't affect your production build, but you have no difference in behaviour between debug and production builds. |
It seems that all issues are related to order of the data, so I'm going to close the issue. Feel free to ping me or re-create the issue (or re-open this one) if you'll find something else. |
Lightweight Charts Version: 3.1.2
Steps/code to reproduce:
Set Markers on a chart using chrome/chromium browsers.
Actual behavior:
Some of markers are not showing on chrome/chromium, and some disappears depending on the zoom.
Expected behavior:
All markers should show normally like on Firefox.
Screenshots:
On Firefox:
![Screenshot from 2020-07-25 21-10-25](https://user-images.githubusercontent.com/30210654/88457926-a1167b00-cebc-11ea-9056-a56481f44da2.png)
On Chrome:
![Screenshot from 2020-07-25 21-09-53](https://user-images.githubusercontent.com/30210654/88457939-bc818600-cebc-11ea-842d-2dcb4015d51e.png)
On Chrome (Zoomed in a bit):
![Screenshot from 2020-07-25 21-09-44](https://user-images.githubusercontent.com/30210654/88458091-fd2dcf00-cebd-11ea-8c4e-d75b2f1badd4.png)
Browsers used:
Firefox, Brave Browser and Chrome
The text was updated successfully, but these errors were encountered: