Bug report #4449

strange behaviour of piechart function of QGIS

Added by lokheart _ almost 8 years ago. Updated about 7 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Symbology
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed
Crashes QGIS or corrupts data:No Copied to github as #:14379

Description

I am using QGIS to visual health status of elderly in an elderly home, whether they have medical devices or not is one attribute that I am trying to visualize.

I have create the map using mapwindows, and use R to create a tab-delimited txt file to carry the medical device information (7 columns, 6 columns of 0 or 1, and one uid that will be used to join the bed layer in QGIS.

I used the diagram tab in the properties menu of the bed layer, and pie-chart is being used for visualization: if the elderly have 3 devices, the pie will be presented with 3 parts with 3 different colours. And strange things are visualized.

A majority of elderly do not have any devices (i.e. that should be straight zeros for the 6 column in the txt file). I support no pie chart should be visualized, but QGIS still show a solid pie using the last attribute I have inserted in the diagram tab of the properties menu.

I have tried to insert a csvt file to explicitly state that those medical device columns are integer, real, but it still fails. QGIS visual an attribute with value 0 as 1, if all of the attributes used for plotting are straight zeros.

Can anyone help?

Thanks.

The question was asked at GIS stackexchange: http://gis.stackexchange.com/questions/16194/strange-behaviour-of-piechart-function-of-qgis

History

#1 Updated by Giovanni Manghi almost 8 years ago

Can you please attach a small sample of your data?

#2 Updated by lokheart _ almost 8 years ago

Giovanni Manghi wrote:

Can you please attach a small sample of your data?

I can give it to you tomorrow morning, but it's something like the one below:

"uid" "A" "B" "C" "D" "E" "F"
"1111-R1" 0 0 0 0 1 0
"1111-R2" 1 0 0 1 0 0

Hope this helps, thanks again.

#3 Updated by Nathan Woodrow almost 8 years ago

I can confirm. The pink one at the top should have nothing, or at least see though.

Looks like a bug to me.

For now the best way to handle this would be have two layers using the query string that underdark put on GIS stackexchange. The first layer with:

A + B + C + D + E + F > 0 to show all the records that have something and have diagrams enabled on this layer.

and the other with

A + B + C + D + E + F = 0 to show all with no devices.

QGIS queries are real time so if you happen to add a devices to one that didn't have one it will show up in the layer with the diagram and not in the second layer.

#4 Updated by Tim Sutton almost 8 years ago

  • Target version changed from Version 1.7.1 to Version 1.7.2

#5 Updated by Giovanni Manghi almost 8 years ago

  • Target version changed from Version 1.7.2 to Version 1.7.3

#6 Updated by Giovanni Manghi almost 8 years ago

  • Target version changed from Version 1.7.3 to Version 1.7.4

#7 Updated by Paolo Cavallini over 7 years ago

  • Target version changed from Version 1.7.4 to Version 1.8.0
  • Crashes QGIS or corrupts data set to No
  • Affected QGIS version set to master

#8 Updated by Matthias Kuhn about 7 years ago

  • Status changed from Open to Feedback

Fixed on my repo:

https://github.com/matthias-kuhn/Quantum-GIS/commit/97a542750cb5c0afac04d3c7d824db4ceb233bfa

Draws an empty (transparent) circle for pie charts with only 0-values.

#9 Updated by Giovanni Manghi about 7 years ago

Matthias Kuhn wrote:

Fixed on my repo:

https://github.com/matthias-kuhn/Quantum-GIS/commit/97a542750cb5c0afac04d3c7d824db4ceb233bfa

Draws an empty (transparent) circle for pie charts with only 0-values.

Hi Matthias, if you are going to merge into master I guess we can close this ticket.

#10 Updated by Paolo Cavallini about 7 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#11 Updated by Matthias Kuhn about 7 years ago

  • Resolution set to fixed
  • Status changed from Feedback to Closed

Fixed in master

Also available in: Atom PDF