-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Plot: Respect the "Order by" clause when plotting #821
Comments
Heh Heh Heh, that's interesting plotting. 😄 This request makes sense. Personally I have no idea how to implement it, but hopefully someone else in the team does. 😀 |
I don't even understand why is this happening :/ |
@revolter It kind of makes sense that somewhere in the code there is a line that says, order the rows by X. It's the exact same plot, but the order of the rows is switched. |
I'll just drop this link here as a reminder for myself: |
The tables/queries sorted by X are drawn using QCPGraph as before. Since QCPGraph does automatically sort by X, we change to QCPCurve that requires a third data vector to reflect the order. We get that from the current row order. In the case of curves, only None and Line is supported as line style. Since the order is now important for the plot, it is automatically updated whenever the user sorts by another column in the browsed table. This addresses issue #821 and indirectly fixes the problem of incorrect point->row selection link when the table is not sorted by X, reported in issue #838.
@struck89 I've implemented a change for using the QCPCurve when the table/query is not sorted by the X field. That looses some options for the line style, but only for that case. When the table is already sorted by X, everything stays the same. Could you test with the next nightly build how does it work with your data? Indirectly, this solves too the problem that you reported in #838 about the incorrect row being selected. |
@mgrojo So, now that we have reached this amazing point, now I will throw you another challenge to think about: You would need for curve 1, x1 and y1, for curve 2, x2 and y2. (btw, in my case, I don't see any loss in plotting functionality) |
Now that the plot may contain graphs and curves, the plottableCount() function must be used instead of graphCount() for checking whether the plot has any plotted items. This had the effect reported in issue #821 of breaking the enable check for the fetch-all button.
@struck89 Good catch about the fetch-all button. This is due to the oddness that the QCustomPlot API has for the curves. It is clearly an afterthought. That should be fixed now. Your new idea deserves some thought 🤔 Could you open a new issue for that and develop a bit the user story 😄 It will probably not materialise soon, since we want now to get ready for the 3.11.0 release. |
By the way, the bit lost for the plot when there are curves is that only None and Line can be selected as line type. The other styles are only allowed by QCustomPlot for graphs. |
Sounds like the capabilities of the Plot pane are really expanding. Should we create a "How to use the Plot pane" page on the wiki (with screenshots)? |
Wiki suggestion copied in #226. It seems this can be closed now. |
Now that the plot may contain graphs and curves, the plottableCount() function must be used instead of graphCount() for checking whether the plot has any plotted items. This had the effect reported in issue #821 of breaking the enable check for the fetch-all button.
Details for the issue
The plot is done in such a way, that the variable selected as "X", is the one that forces the order of the connecting points, So take a look at this nice loop:
I can't turn on the lines, because it does not respect the order I asked (order by t):
Useful extra information
The first color it appeared when making this mock example was YELLOW!!
I'm opening this issue because:
I'm using DB4S on:
I'm using DB4S version:
I have also:
The text was updated successfully, but these errors were encountered: