3

I need to draw simple histograms in QGIS version 1.8 linked to data from an imported DB.

I need a double bar diagrams (eg: male/female - in/out) but I only find the possibility to set pie charts. Is it possible to draw histograms with high proportional to the value?

  • 2
    Which version of QGIS are you using? – Matthias Kuhn Jul 18 '13 at 10:27
  • @MatthiasKuhn QGIS 1.8 – Ale Oct 16 '13 at 13:24
5

QGIS 1.8

In QGIS 1.8 this type of diagrams is only provided by the "diagram overlay plugin" (See Plugins => Manage Plugins). Once enabled you have in the vector layer properties a new Tab "Overlay" which offers "Bar Chart" in the dropdown.

enter image description here

QGIS 1.9 / 2.0

With QGIS master (soon to be 2.0) it is possible to draw piecharts, histograms and text diagrams with the builtin diagram engine (the diagram overlay plugin has been removed, as it is superseded by this) In the vector layer properties => Diagrams you can choose "histogram" as type.

Unfortunately, with neither of these it is possible to draw "double" bar diagrams.

  • I try this plugin but I am no able to view charts... – Ale Jul 18 '13 at 10:43
  • Make sure you choose a classification attribute and assign a size to a given value. In my example, a value of 9 will lead to a bar length of 100. – Matthias Kuhn Jul 18 '13 at 10:48
  • My first problem is that I cannot view the linked filed from the attributes, while in the diagrams I can see all the filed and I can add a piechart with my value – Ale Jul 18 '13 at 10:53
  • Not sure if I understand your question... Maybe the fields are not in a numeric format? – Matthias Kuhn Jul 18 '13 at 11:08
  • the format is Real (19+5 char) and I can set piecharts in "diagrams tab" normally using the value joined from a DB, while in "overlay diagrams tab" I can not find this value in attributes. – Ale Jul 18 '13 at 11:20
3

I have found a not-simple solution. It is like have two different bar diagrams on the same table. This is the way:

  1. Choose "simple symbol" in "style tab new symbology"
  2. Choose "vector field" in "type layer"
  3. Choose "only high" in "vector type" and set info for parameter1 (colour=blue, large, and high attribute from the DB)
  4. Set a negative offset (half of the large dimension)
  5. Add a new symbol
  6. Choose "only high" in "vector type" and set info for parameter2 (colour=red, large, and high attribute from the DB)
  7. Set a positive offset (half of the large dimension)

Then you can have your histogram with two bars. I hope it help other users, but if anyone know an easy way I'd like to know it.

In the image below you can see the final result of the process.

bar diagram

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.