-
-
Notifications
You must be signed in to change notification settings - Fork 391
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
scale.range of default x/y scales should be initialized without series #309
Comments
Might actually be something wrong with my build configuration. Please disregard until I figure it out. |
it's almost certainly the next commit following 1.2.1: fe5fac7 that code runs for y scales of empty charts (without data). the default scale ranging functions get initialized as part of iterating the series arrays (since series can implicitly initialize new scales simply by specifying a unique key): https://github.com/leeoniya/uPlot/blob/master/src/uPlot.js#L535 however, there are always default x and y scales created on init. so i'm guessing you are initializing a data-less plot with no y series? (i'm on a phone but i think those are the necessary conditions here). a repro would obviously help. |
I believe I was doing this but I switched some code around and generated data before the graph is initialized (it's a live visualization so data is streaming) and it does not seem to change anything. I am hoping to get a live reproduction up but that is having it's own different issue :P I'll get back to you once I figure it out. |
Ah. It was an empty y series. My apologies. It was due to some async problems. |
no problem. i still think this is an issue, though. the solution is most likely to also init https://github.com/leeoniya/uPlot/blob/master/src/uPlot.js#L246 |
I'm seeing the same issue since 1.2.1:
Is there an easy workaround? I display my empty chart and then dynamically add items to it. |
i think the recommendation going forward if you want to handle a data-less (or series-less) case will be to explcitly provide see the first example here: https://github.com/leeoniya/uPlot/blob/master/demos/no-data.html |
Interesting. Before I was just doing this in my scales:
Your example has me doing this now which works:
|
yeah, that method turned out to be tricky to support in the case when you go from data to no-data but the original min/max setting is now gone (since those actually become mutable min/max values). also in combo with range it becomes very inconsistent to explain or reason about, so using only range handles all cases clearly. |
I'm late but thank you so much! You're awesome <3 |
I get the following error when upgrading to uPlot 1.2.1:
Line in question:
Honestly not sure if this error is due to 1.2.1 specifically. I upgraded directly from 1.1.2 so I will roll back and see which versions causes the issue.
The text was updated successfully, but these errors were encountered: