Skip to content
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

Data order using x axis field instead of order of insertion (i.e. $id) #308

Open
MatparMcWolfie opened this issue Dec 17, 2022 · 3 comments

Comments

@MatparMcWolfie
Copy link

This might be a feature request rather than a bug to fix.

I've just started messing with Dataplotly and am trying to create scatterplots on time series. Basically, I want to visualize the monthly variation in water table levels.

I understand the plugin orders data using order of insertion (I'm guessing it's using $id, since they correlate). The problem is my data isn't necesseraly inserted into the table in chronological order because of logistical reasons. Instead, the level and date of measurement are saved in different fields. I then plot the water level with dates on X axis.

Since the the data is showed in order of insertion in the scatter plot, an issue sometimes occurs when I add a line symbol to the plot:

image

The obvious solution here would be to hide the problem by removing the line and keep only points but I need the line in my reports.

Would it possible to order data in relation to the X values instead of $id. It would make much more sense in scatter plots anyway.

Thanks a lot.

P.S. I was browsing through the page juste to make sure this issue had not been posted yet and I came across this:
#305
In which you can find the following GIF, showing a sorting option:
187727159-1d49c7d2-1b76-4241-a772-2c8b65faa206

I am now questioning if I have the latest version of the plugin since I cannot find such an option on my instance:
image

Currently running QGIS 3.28.0, and Data Plotly 3.9.2.

What am I doing wrong?

@ghtmtt
Copy link
Owner

ghtmtt commented Dec 19, 2022

I understand the plugin orders data using order of insertion (I'm guessing it's using $id, since they correlate).

that's right. We are planning to refactor the whole DataPlotly core functionalities in order to have a pandas dataframe to work with. Then we can use the pandas dataframe options to sort and do a lot of more stuff: https://plotly.com/python/line-and-scatter/#data-order-in-scatter-and-line-charts

For the moment you can use the Order by expression algorithm to sort the features depending on a field or expression

P.S. I was browsing through the page juste to make sure this issue had not been posted yet and I came across this:
#305

this is because it is still opened and not merged in the master branch.

@husnimubarok
Copy link

husnimubarok commented Apr 23, 2023

can you help me to show the correct "Order by expression" way in the current version 4 when I need to descending the field "hh_est" and got it sorted in the plot

image

@ghtmtt
Copy link
Owner

ghtmtt commented Apr 26, 2023

the PR is not merged yet and therefore this option is not available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants