DataPlotly icon indicating copy to clipboard operation
DataPlotly copied to clipboard

Ordering of bars in histogram?

Open magerlin opened this issue 2 years ago • 5 comments

I cannot figure out what determines the ordering of bars in a histogram.

With a text attribute as X field I would expect the bars to be shown in alphabetical order but that is not the case: Bar Order

magerlin avatar Jun 12 '23 11:06 magerlin

can you please share the input data (also a small piece of it)?

ghtmtt avatar Jun 19 '23 05:06 ghtmtt

Sorry for my late reply – I have been on summer holiday.

Please find attached data and Qgis project as well as a PDF illustrating the problem.

The Layout in the project is an atlas and I want to make a histogram only for points inside the current atlas feature.

If I tick “Only use features in visible map” I get the expected sorting order of the bars in the histogram – but this is not the histogram I want to show.

With no ticks or tick in “Use only features inside atlas feature” I get another and for me not right sorting order.

I have tried adding starting letters a to d to the intervals (as shown in the PDF) but it did not make any difference.

Histogram.zip

magerlin avatar Jul 24 '23 09:07 magerlin

Could it have an order column organize the data plot? I have the same problem. I create a Bar Plot with round numbers but when its plotting, the data order by the ID of attribute table (It create an order X axis based on the round number, but the color of the bar if I create a customization rampage color by the original number -decimal 0,000-, its color based on ID, so it don't have uniform transition colors).

WilliamBelini avatar Aug 08 '23 01:08 WilliamBelini

I really need also ordering the X-values for histogram. Is the PR order by expression soon merged ?

palight avatar Jul 02 '24 14:07 palight

the solution: You need reorder the data table Id, by column, using MMQGIS. It will change the Id by the order you want. And the chart will plot correctly.

WilliamBelini avatar Jul 05 '24 18:07 WilliamBelini