1. Home
  2. Docs
  3. GLayer
  4. Charts
  5. OrdinalChart

OrdinalChart

Example of an OrdinalChart.

Ordinal chart types are the main way to display OrdinalField (categorical) data, using a chart.js Bar Chart. An Ordinal Chart can also be used to show LinearField data, where one bar in the chart will be one bin from the field.

In addition to Common chart settings, the OrdinalChart type has the following settings:

  • X Label:
    Label for the X axis (shown below the chart).
  • Y label left/right:
    Y label for the left/right axis (shown next to the chart on the left/right side). The right label will only be shown if at least one data object is set to use the right axis.
  • Field ID:
    The ID of the field this chart will display and filter – each domain column (or bin for linear fields) from this field will be one bar in the chart.
  • Data:
    An array of dataset objects with the following properties:
    • Values:
      The ID of the field to get values for. Data returned will be selected from the database column according to this field’s sourceName setting.
    • Function:
      Aggregation function to use when calculating data for this dataset.
    • Y scale:
      Scale for the Y axis. Can be set to Linear (default), Logarithmic, or Dynamic (will switch between Linear and Logarithmic depending on displayed data).
    • Label:
      Label for this dataset (shown in chart legend).
    • Y axis:
      Selects which axis this chart should use (Left or Right). Useful for showing multiple datasets with different values in a single chart.
  • Use values only:
    When set to true, the Field ID setting will be ignored, and individual dataset Values settings will be used instead. Useful when comparing datasets with no common x Axis.
  • Compare type:
    Defines how this chart should behave in the compare module. Can be either basic (base and compared datasets are side-by-side), sum (datasets are stacked on top of each other), difference (the selected dataset value is deducted from the base), or none (the chart is not visible in the compare module).

Was this article helpful to you? Yes No

How can we help?