Wednesday, 22 July 2015

Creating Charts and Graphs in QGIS 2.8



Our dataset for this demonstration consist of a Point feature layer-ConcentrPT, a CSV Table of attribute data on the points and a polygon feature layer of the extent in which the points are located. See the layers window of the screenshot below.
Capture-1

To download and practice with our dataset, click this link and download the zipped folder:
https://drive.google.com/folderview?id=0B8z8JZ83pZMaflZMcGJaZm1VT0VKbldPZFlVZDZnZWE0Y1ZhbF9GTmNfZEFJOGRVcEduNUk&usp=sharing

Let us first do an Attribute table JOIN between the attribute table of Spatial Point layer and the CSV table.
Right Click on the Point feature layer > Properties. (Another option is to double click the Point feature layer).
Capture-2

In the Layer Properties window, Click on Joins (red boxed lettered 1). Click on the green + button sign (red boxed lettered 2) to add a Join.
Capture-3

In the Add vector join dialog box, select the Join Layer and the attribute fields for Join field and Target field. These fields must have similar values to be able to perform the join. Click OK.
Capture-4

Right Click on the Point feature Layer > Open Attribute Table. Inspect the attribute table to ensure the Join was successful. The red boxed area are the values from the CSV table now joined to the corresponding locations on the attribute table of the Point feature layer.
Capture-5

With our data ready, let us proceed to create a chart illustrating the %concentrations of the different elements at each location on a map.
Right Click on the Point feature layer > Properties.
Capture-6

In the Layer Properties window- Click on Diagrams (red box 1) > Diagram Type (red box 2) to choose the diagram type. First let us pick Pie chart.  Below are four tabs, Appearance, Size, Position and Options.
Move down to the Attributes section. Select from the attributes the fields that would make up the chart, Click on the green + button to add to the Assigned attributes tab.
Capture-7

Click on Size tab. The default size is 30mm but can be adjusted by the User. Size units come in mm and map units.
Capture-8

Click on the Position tab. Placement has various options and determines where the chart will be placed. For the demo, Over Point is selected. Click Ok.
Capture-9

In the screenshot below are the Pie charts that were created. The Pie chart shows the %concentration of each of the elements on every location.
Capture-10

Next we decide to create Histogram diagrams instead of Pie charts to illustrate the information.
Right Click on the Point feature layer > Properties. In the Layer Properties window, click Diagrams and in the Diagram type select Histogram.
For the Histogram, the Appearance and Position tabs are the most relevant. In the Position tab, Placement is selected as Around Point this time around.
Capture-14

In the Appearance bar, adjust the Bar width from default to a suitable value. For the demo, Bar width value was increased to 4.
Capture-15

Viola! and there are our Histogram depicting the %concentration of different elements at each point.
Capture-16

Thank you for reading. Send your comment and feedback.

No comments:

Post a Comment