Geographic Information Systems Asked by David Addy on June 27, 2021
I have successfully created a bar chart using Data Plotly within QGIS 3.14.16. The x axis consists of 17 place names (NAME) and the Y axis shows the value (VALUE IN £P) of one particular lease at each location, ranging from £0 to £46. This is an historical chart. However I would like the plots to be ordered by value so that the lowest value is on the left and the rest graduated to the highest value on the far right of the plot.
Is this possible? Can any kind person provide me with an expression to achieve this please?
By default, Plotly represents your data in the order of insertion. The first inserted element has the id 0. Here is a tip to get the expected result.
You can also retrieve this value by creating a new field and assigning it the value $id.
Here is the result obtained.
A trick is to directly modify the file containing the attribute table (example .dbf file for the shapefile). You cannot edit this file if it is opened in QGIS. Sort the VALUE field in descending order if you want to display the data in descending order and then save. This will change the element IDs.
Add the layer to your project and here is the result.
Correct answer by Vincent Bré on June 27, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP