-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Time scale marks customization #226
Comments
Hello! I can customize time formatting, plese refer here |
@eugene-korobko this is only for the popup? but how about the timescale axis labels?
|
Yes, currently we don't have support of this customization and there is some reasons (at least that every label should have certain width to look pretty and to don't overlap each other). But we need to provide API to modify it (I don't know how at the moment). |
@deantheiceman Meantime, can you please provide a bit more information regard what do you want to achieve/trying to fix? I hope it might help us to make correct decision about the fix. |
Sorry for the delay, I was experimenting with alternative options in the mean time but find myself coming back to lightweight charts as the best solution for what I need Essentially if my server returns data and I send the data to the chart as a Unix timestamp on the client side I want to be able to display the timestamps in the client side time Previously I used to just do a simple offset and calculation before passing it into the chart. But that doesn't seem to be possible when using unix timestamps to pass through the data |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Meantime you can share your feedback and thoughts in #362 if you wish (we do really appreciate every feedback) 🙂 |
Another use case why we need to have a way to customize it is seasonality chart (see #377). |
Some time has passed since you closed this ticket @timocov, and I still cant see a way to custimize the tickmarks of the time scale to stick to specific points on the scale. Im my case I want the labels to only apear at full hours, but sometimes they appear on 1 min after the full hour. Another problem I have not found a real solution for is to prevent the last label (20:00 in this case) to not be cut off because the scale ends) The only solution I found to that was to use the rightOffset property on the timeScale (https://github.com/tradingview/lightweight-charts/blob/v3.6.1/docs/time-scale.md), but then the whole chart would have that padding. Also Its measured in bars, and bar widths change througt my app, to the offset would be a diffrent size in pixels on tge charts, depending on the data. I am running v3.6.1, but as far as I can see in the changelog for the latest v3.7.0, this problem was not solved. |
@maxbethke we didn't provide a feature to change the algorithm of generating tick marks though, because it looks pretty low-level and it is needed for a few users probably. Instead, I'd say that we need to improve our internal algorithm to avoid such situations. I had an idea that we could ignore tick marks lower (in terms of their weight) than the weight of the majority of tick marks. Let's say if you need to display 4 hour labels and 2 sub-hour ones (minutes, seconds) then just drop these 2 sub-hour labels because they won't have any sense in comparison to other labels. Probably you will have other ideas how to improve it. I believe it should be done somewhere here or here.
Can you provide an example please? It seems that this issue was fixed in case when you're unable to scroll behind the last/first point, i.e. when fixLeftEdge or fixRightEdge is enabled. Probably we could extend this behaviour on other points as well, but we need to specify a condition for that. |
Here is a codesandbox that should make both problems clear. As you can see, the 13:00 label gets cut of at the very right end of the time scale @timocov |
Interesting, I didn't think about this case. @maxbethke could create a separate ticket for this please? It is pretty similar to #835, but with the only difference that instead of fixing edges you disallow scrolling and scaling. It seems that we need to do the same logic for case when a scroll is disabled (disabled scaling is fine I believe). |
Thats for the second problem @timocov, but for my first problem, I recall: |
@maxbethke could you please create a jsfiddle/codesandbox example of the issue? I'll create a ticket to improve tick marks for this case (at least we can try). |
The above mentioned codesandbox should explain the issue. It does not show occasions where the tickmark is displayed exactly 1 min after the full hour, but it shows 3, 4, 9 and 19 mins, which is the exact same problem in my mind. Does that clarify the issue for you @timocov? |
@maxbethke So do you want to display 09:00 for data which has 09:04 time? Is there a reason why you might want this instead of correcting the date of your bars? It looks strange for me to be honest and I don't think that the library will do this (display wrong time). I thought that you faced a bug where you have 09:00 and 09:04 bars but the library displays 09:04 instead of 09:00, but now it seems that the library works correctly. |
No!
Yes! That is exactly it. The way they get displayed right now pose a UI issue for me and my customer |
But on your example above I don't see a bar at 09:00 in the data, instead I see a bar at 09:04 which is displayed on the time scale.
So, can you provide an example of such case, where you provide a bar with time 09:00 but the library displays it as 09:04 please? |
hi @timocov ! I have the same request, but another use case: So we need to show ticks only for these 2 points, so user can understand that this chart is related to some time in the past (like 2020/01/12 - 2023/02/11). Is it possible to show only 2 exact ticks on the time scale? |
Currently there is no support to customise the time scale with even at least formatting.
I have two problems:
Any chance we can get this soon?
The text was updated successfully, but these errors were encountered: