Charting Tools
What is the Charting Tool?
The Chart plugin provides a map-based charting tool that enables the visualization of one of the most common time series data in a spatial context, i.e. time series monitoring data available on specific sites such as weather stations, or in fixed regions such as watersheds. With the distribution of the sites or regions represented as a map service, the Charting Tool enables the creation of a Line Chart or Bar Chart for the time series data by sites/regions. This time series dataset may contain more than one variable, which can be charted accordingly by both the Line and Bar Chart.
Figure 32 shows an example of map-based charts for time series visualization. The Line Chart shows data collected for one of the shellfish sites under monitoring across Canada. By clicking a monitoring site on the Shellfish Monitoring Map below, the user will see the Chart pop up. The sliders for the X and Y Axis allow the user to filter results to show specific value ranges or time ranges respectively. More information on the data source can be found from the metadata.
An example of a Bar chart is provided in Figure 33 representing data collected from one of the Independent Environmental Monitoring Stations. The data verify that the public and environment around CNSC-regulated nuclear facilities are not adversely affected by releases to the environment. More information on the data source can be found from the metadata.
In addition, the Charting plugin supports Pie Chart, which may be used to visualize non-time series data.
When to use it?
Line Chart
If you have a map service created to represent monitoring sites or fixed regions and if time series data is available over each site or region, the Line Chart is the preferred choice for visualizing the time series data for several reasons:
- The advantage of showing trends of change, which is often of central interest for monitoring;
- The ability to show a long series of observations;
- The capacity to include a good number of lines each corresponding to a variable; and
- The capability to show the trend of a variable in comparison with that of other variables.
In this example Figure 34, the Line Chart was used to visualize the time series data from data collected from Shellfish Sites. The data is dynamically represented in a rendered line chart where the user can use the onscreen slider to dynamically manipulate the data. The Line Chart supports a slider to filter results by the date or by the results.
Bar Chart
The Bar Chart is preferred to Line Chart when the site/region-based time series data has sparse observations, for example, three observations or even less. A Bar Chart in this case can be used with each observation represented by a bar, and successive bars to show the changes over time.
In this use case (Figure 35), the map-based bar chart tool was used to visualize the Independent Environmental Monitoring Station time series data. The collected parameters was used along the x-axis while the y-axis represents the collected sample results. The year of data collection was used as the variables (i.e. 2013, 2015, 2016). Bar Chart was preferred to Line Chart for visualization of this dataset due to the limited timestamps available. More information on this dataset can be found in the metadata.
How to use it - A use case
Using the Shellfish Monitoring data for a use case, we illustrate how to use the Charting plugin to create map-based Line Charts. This dataset provides marine bacteriological water quality observations for bivalve shellfish harvest areas in Canada (British Columbia, New Brunswick, Newfoundland, Nova Scotia, Prince Edward Island and Quebec).
Preparing the Data
Linked Tables
Linked Tables refers to using two or more tables that share the same field. This data structure establishes a relationship between the datasets through which a single table containing all the parameters and values is related to the reference data. In the use case example, Shellfish Water Classification Program, the data structure of this dataset reveals that relationship tables are used. The layer
Data Structure
Data structure here refers to the organization of the data file for use by the Chart plugin. It takes into consideration linked tables and efficient access and modifications of data. The Charting plugin supports three options of data structure.
Option 1
Following the same structure as the use case example (Figure 36), the data can be organized using linked tables. The map service has the layer
Option 2
Where a large number of parameters are observed on a site, you may use Option 2 to organize your data for use by the Charting plugin. Similar to option 1, the data is mapped as a layer and linked to a table that holds the records of time series observations (Figure 38 (a)). The difference from the previous use case is that there is a large number of parameters being observed, as shown in Tested substances of Figure 38 (b). In this case, the time series data can be organized in a manner to avoid making the linked table too wide.
As shown in Figure 38 (b), there is now one field that lists all the parameters
Option 3
Organizing the time series data where fields are created by concatenating the data into one field as inline text. This structure requires that the data be formatted in a specific way. Each field to be charted is required to have the data listed and separated using parenthesis and commas. (Figure 39). If your data is not already in this format, this data structure will require a detailed workflow to get the data in this format.
This method is not recommended because it requires a structured workflow to concatenate the data in a new field to meet the requirements. Each parameter observed would require a new field to be created. However, if there are constraints in the data which require and suits this data structure it is available to be used for charting.
Configuring the Line Chart
Before you begin, Ensure that all Layers to be used should be configured in Authoring tool under the
Step 1. Enable Charting plugin.
Navigate to the
Step 2. Define Axis Labels
-
Choose the
“Type” and set the Title for the X-Axis. Under the“Type” , choose the option that best suits the intended use case.-
Date – If set, the expected format of the date data would be in the form of Year-Month-Day or follow a similar convention. (e.g., YYYY-MM-DD; DD-MM-YYYY) -
Linear – If set, the expected format of the date data would be linear (e.g., YYYY)
-
In the use case example, the
- Set the
“Type” and Title for the Y-Axis Under the“Type” the only option available is Linear (Figure 41).
Step 3. Select Layer
-
Layer ID - Under theLayer Id , select the layer with which the plugin will work. Thelayer Id is automatically generated when adding a map service to the Authoring Tool. Each layer will have a unique Id generated. Ensure that the layer to be used is being selected. In the use case, this layer is“Shellfish Sites” (Figure 42). -
Name Field – Choose a corresponding field to be used to identify with the generated Charting visualization. In the use case, the“Site” field was used to identify what site data is being displayed. -
Chart Data Type – Choose the best option that relates to the data structure used for the dataset. In the use case, Link was used because the data structure uses Linked Tables. -
Link URL – If the link is set as theChart Data Type , provide the URL link of the linked table. This can be found on the map service page. In the use case, the URL link for the Linked table was provided. -
Link Field – If Link is set as theChart Data Type , provide the common field used for the relationship between the tables. In the use case, the“Site” field was the relationship field
Step 4. Configure Data Parameters (Figure 43)
-
Type of Link – Choose the type that reflects how the data is structured.Single – Choose this If the data structure of your data follows Option 1 (see Preparing data), i.e. the names of parameters being observed are shown only at the top of the linked table. This is the case for the Shellfish use case. See Preparing the data - Option 1 for more details.Multi – Select this If Option 2 applies to your data, i.e., there is one field of the linked table having parameter names as the values. one field with the date and one field with the results. See Preparing the data – Option 2.
-
Link Field – Provide the name of the field that links the layer and the linked table -
Date Field – Provide the field name that corresponds to the“Date” field of the linked table. In the use case, this field name was“Date” . -
Label Values – If the“Type of Link” was set to multi, provide the field name that corresponds to the units of measure. Otherwise, this remains empty. In the use case, this was left empty because the“Type of Link” was set to“Single” -
Measure Field – Provide the field name that corresponds to the data to be displayed by the Chart. In the use case, the field name used was”FC_MPN_CF_NPP_100_mL” . Note that the exact field name must be used. -
Prefix – If required, provide a prefix to be displayed when the user hovers over the data. In this use case, when the user hovers the mouse over the chart data,“Concentration” will be used as the prefix before displaying the value. -
Suffix - If required, provide a suffix to be displayed when the user hovers over the data. In this use case, when the user hovers the mouse over the chart data,“by 100 / ml” will be used as the suffix after displaying the value.
Optional, if more data Fields are required to be displayed, click on the
Step 5. Details Option
Optionally (Figure 44), under the
Definition of parameters
Listed in the following table are the definitions of all the parameters available when using the FGP Authoring Tool to configure the Charting plugin.
Parameters | Description | |
---|---|---|
General | Type | Determines the type of chart to be created. This includes a pie chart, bar chart or line chart |
Title | Determines the chart title to be displayed | |
Options | Datasets Colors | An option to include hexadecimal color values to use to display the chart |
Label Axis | Type | Determines the type of label to be used. The label names can be retrieved from a field from the layer (Linear or Date for line chart) or configuration. (Linear or Date) for the line chart. |
Title | Determines the title name to be used for the different axis | |
Layers | Id | Determines the layer id as defined in the layer section. |
Name Field | Determines the field used to identify the data being displayed by the chart. | |
Chart Data Type | Determines the type of data to be expected by the Charting plugin (Inline, Link).
|
|
Link URL | Determines the URL for the linked Table. This is only required if the “Chart Data Type” is set to “Link” | |
Link Field | Determines the field name that links the layer to the data table. This is only required if the “Chart Data Type” is set to “Link” | |
Data | Determines the different parameters for the layer to use to create the chart
| |
Details | Specifies if the details panel should be customized. Custom details can be included using the markdown notation. |