...
Code Block | ||
---|---|---|
| ||
{ "name": "orgs", "titletype":"key figure"Organisations", "descriptioningredient": { "valueColumn"Number of organisations deployed.": "#org", "typeaggregateFunction":"key figure" "distinct-count" }, "ingredientuiProperties": { "valueColumntitle": "#orgOrganisations", "aggregateFunctiondescription": "distinct-count" },Number of organisations deployed." "unit": "orgs", "numberFormat": "us" } } |
This will generate a key-figure chart showing the number of unique organisations mentioned in the first column with the HXL hashtag “#org”.
Here is a slightly more-complex example, creating a chart (bar or pie, chosen automatically) that shows the number of unique organisations for each admin1 subdivision (“#adm1”):
Code Block | ||
---|---|---|
| ||
{ "title": "Organisations", "type":"chart", "ingredient": { "aggregateColumn": "#adm1" "valueColumn": "#org", "aggregateFunction": "distinct-count" }, "uiProperties": { "title": "Organisations", "unit": "orgs", "numberFormat": "us" } } |
bite properties
name | The internal reference name for the bite (not displayed). |
titleChart title to | displayThe display title for the Quick Chart. |
descriptionChart description to | displayThe display description for the Quick Chart. |
type | Type of chart to display. key figure: a single numeric indicator (e.g. total population, number of organisations) |
ingredient | Definition of the data to use in the chart (see below). |
uiProperties | Definition of how the chart should be displayed (see below). |
...
uiProperties object fields
title | The display title for the Quick Chart (overrides top level) |
description | The display description for the Quick Chart (overrides top level) |
unit | The label to place under the number for a key figure. |
numberFormat | The format to use for numbers: us: English format (“,” as thousands separator) If not provided, the format will be standard computer number format, with no thousands separator and “.” as the decimal separator. |
showGrid | Show a grid behind a bar chart or timeseries if true. |
swapAxis | Swap the X and Y axes in a bar chart if trueFor a bar graph, place the labels along the Y-axis if true, or along the X-axis if false. |
color | Hex RGB color code for a bar chart, e.g. “#FFFF00” for yellow. |
sortingByValue1 | Sort a bar chart by values. Use “ASC” for ascending, or “DESC” for descending. |
sortingByCategory1 | Sort a bar chart by categories (values labels in the aggregateColumn). Use “ASC” for ascending, or “DESC” for descending. Note: this will work only if sortingByValue1 is present and explicitly set to null. |
Recipes
Recipes generate a list of bites that the user can choose from, based on the data available in the source dataset. It is similar to a Bite, except that “ingredient” changes to “ingredients”, and inside ingredients most of the fields become plural: aggregateColumns, dateColumns, valueColumns, and aggregateFunctions (but not filtersWith or filtersWithout). Each of this contains a list HXL tag patterns, for generating bites that the user may choose (depending on which columns appear in the source data). This example will provide options for the number of orgs, activities, sectors, or subsectors grouped by region, country, or 5 admin levels — up to 28 different bites, depending on what’s present in the source data:
...