Category Bar Chart Node

Similar to a bar chart, but specifically focuses on categorizing data into discrete groups or categories, making it easy to compare across different categories.


What is a Category Bar Chart?

A category bar chart is a useful visualization tool that organizes data into discrete groups or categories, allowing for easy comparison across these categories. Each group is represented by a bar, making differences in data visually apparent. This type of chart is particularly effective in showing the distribution of data across various predefined categories and is beneficial in analyzing patterns or trends within the data set. For example, it can be used to compare sales performance across different product categories or to show frequency distribution in survey responses.

Inputs

The category bar chart node has two mandatory inputs. These are:

Input

Requirement

Comments

X-Axis Field

Mandatory

This is the field name within the incoming JSON payload that contains the data to be displayed on the widget. Each unique x-axis field will be represented by a vertical bar on the chart

Data Field Name

Mandatory

This is the field name within the incoming JSON payload that contains the data to be displayed on the widget.

How to Use

Implementation

In the Rayven Workflow Builder:

  • Select Visualizations.
  • Drag the category bar chart node to the canvas.
  • Provide an input to the category bar chart node by connecting it to another node.
  • Double click on the category bar chart node to open the configuration window.

Configuration

Section: General

This section contains basic configuration elements required for any category bar chart implementation

Field

Requirement

Comments

Widget Name

Mandatory

Enter a name for this node.


This provides a handle to which you and others can refer, so it should be simple but meaningful and explain the node’s purpose.

Widget Subtitle

Optional

Additional text that can be used to explain the data presented by the node. 


This will appear directly under the Widget Name, in a smaller text size.

Device/Device Label Name

Optional

Select this checkbox to display the device or label name on the widget.

Category Bar Type

Mandatory

Select one of the following from the dropdown menu

  • Regular
  • Dynamic

When “Regular” is selected, column names need to be configured manually.

When “Dynamic” is selected, column names will be dynamically created based on the data received.

Data Display

Mandatory

Select one of the following from the dropdown menu

  • Cluster
  • Stacked

Direction Display

Mandatory

Select one of the following from the dropdown menu

  • Vertical
  • Horizontal

Calculation Interval

Mandatory

Enter an integer to represent the interval for each calculation.

Units of Measurement

Mandatory

Select the units of measurement from the dropdown menu to be used for the interval calculations:

  • Seconds
  • Minutes
  • Hours
  • Days
  • Weeks (Start from Monday)
  • Weeks (Start from Sunday)
  • Months
  • Years 

For example, if the following is configured:

  • X-axis time interval = 1
  • Units of measurement = Hour
  • Function = average


Then the chart will calculate the average value for each column for the hour.

Widget refresh interval (sec)

Optional

Configure how often the chart widget will refresh. The default is every 60 seconds.

Name of X-axis

Mandatory

Enter a name for the x-axis label.

Name of Y-axis

Mandatory

Enter a name for the y-axis label.

Range Min

Optional

Provide the minimum value for the y-axis.

Range Max

Optional

Provide the maximum value for the y-axis.

Show Total

Mandatory

When the show is checked, the category bar chart will display the total value of the different groupings per stack or cluster.



Section: Regular Category Bar Chart Type

This section contains basic configuration elements required for each category that appears on the chart

Field

Requirement

Comments

X-axis Field

Mandatory

This is the field name within the incoming JSON payload that contains the data to be displayed on the widget. Each unique x-axis field will be represented by a bar on the chart

Name of X-axis Category

Mandatory

Enter a name for each category that appears on the chart.

Users will be able to set the order of the category by clicking and dragging the column handle on the left-hand side.

Function

Mandatory

Select one of the following from the dropdown menu:

  • Last value received
  • Sum
  • Average
  • Min
  • Max

Decimal Precision

Optional

Enter the number of decimal places to display for each field.

Hex Color

Optional

Select a color for each field using a hex or RGB code. If no selection is made, a range of default colors will automatically be used.



Section: Dynamic Category Bar Chart Type

This section contains basic configuration elements required for each category that appears on the chart

Field

Requirement

Comments

Data Field Name

Mandatory

This is the field name within the incoming JSON payload that contains the data to be displayed on the widget.


The expected data format:

{

    "data_field_name":

        {

            "Category 1":[{"Legend 1":"11"},{"Legend 2":"21"}],

            "Category 2":[{"Legend 1":"12"},{"Legend 2":"15"}],

            "Category 3":[{"Legend 1":"7"},{"Legend 2":"25"}]

        }

}

With the sample data above, 3 categories will be created where each will have bars showing Legend 1 and Legend 2.

Default Function

Mandatory

Select one of the following from the dropdown menu

  • Last value received
  • Sum
  • Average
  • Min
  • Max

Units of Measurement

Mandatory

Select the units of measurement from the dropdown menu to be used for the interval calculations:

  • Seconds
  • Minutes
  • Hours
  • Days
  • Weeks (Start from Monday)
  • Weeks (Start from Sunday)
  • Months
  • Years 

For example, if the following is configured:

  • X-axis time interval = 1
  • Units of measurement = Hour
  • Function = average


Then the chart will calculate the average value for each column once an hour

Widget refresh interval (sec)

Optional

Configure how often the chart widget will refresh. The default is every 60 seconds.

Name of X-axis

Mandatory

Enter a name for the x-axis label.

Name of Y-axis

Mandatory

Enter a name for the y-axis label.

Range Min

Optional

Provide the minimum value for the y-axis.

Range Max

Optional

Provide the maximum value for the y-axis.

Columns Order Type

Mandatory

Select one of the following from the dropdown menu

  • Column Name
  • Column Value

Columns Order

Mandatory

Select one of the following from the dropdown menu

  • Ascending
  • Descending

Decimal Precision

Optional

Enter the number of decimal places to display for each field.

Show Total

Mandatory

When the show is checked, the category bar chart will display the total value of the different groupings per stack or cluster.



Section: Tooltip Info

Field

Requirement

Comments

Show Tooltip

Optional

When checked, it allows users to display their tooltip text on the widget.

Tooltip Text

Optional

This section only exists when “Show Tooltip” is checked.

Users are able to write any tooltip message they desire which will be displayed on the widget.



Section: Series Settings

This section is only available when the dynamic category bar chart type is selected.

Field

Requirement

Comments

Series

Optional

At the end of the “Series Settings” section, select the “+ Add Series” symbol to add a new series. Multiple series can be added per category bar chart.

Series Type

Optional

Select one of the following from the dropdown menu

  • Value from workflow
  • Reference

Value

Optional


(Only if “Value from workflow” is selected as the series type)

Users can configure the color and function applied to category data shown by providing the JSON key name. 


Using the sample data:

{

    "data_field_name":

        {

            "Category 1":[{"Legend 1":"11"},{"Legend 2":"21"}],

            "Category 2":[{"Legend 1":"12"},{"Legend 2":"15"}],

            "Category 3":[{"Legend 1":"7"},{"Legend 2":"25"}]

        }

}


Users should input the JSON key of “Legend 1” or “Legend 2” on each series.

Function

Optional

Select one of the following from the dropdown menu

  • Last value received
  • Sum
  • Average
  • Min
  • Max

Series Name

Optional


(Only if “Reference” is selected as the series type)

The widget will create a new name to be shown on the category cluster or stack.

Formula

Optional

(Only if “Reference” is selected as the series type)

Users can set up calculations using arithmetic operators on configured Series Names or Values to display as a separate bar on the chart.


Syntax Example: [[Series Name]]*[[Series Name]] 

Straight Line Function

Optional

Select one of the following from the dropdown menu:

  • Sum
  • Average
  • Min
  • Max

If one of these options is selected, the chart aggregates all the values shown for the series and draws a straight line across the chart. 

Hex Color

Optional

Select a color for each series using a hex or RGB code. If no selection is made, a range of default colors will automatically be used.



Section: Group by Device Label

Field

Requirement

Comments

Device label name

Mandatory

There are no labels available in this box until you have saved at least one in the Device Labels section of the Workspace. 


Select a Label to use to filter devices.

Grouped

Mandatory

Select a method for grouping the widget on the dashboard from the dropdown:


No Grouping (widget per device): one widget will appear for each device


Group by device label value (Widget per label value): One widget will appear for each value of a label. For example, if the Label is ‘Colour’ and there are the values ‘Green’ and ‘Gold’, then two widgets will be displayed, one with devices with Colour Label equal to “Green” and one with devices with Colour Label equal to “Gold”


Group by device label name (One widget): Only one widget will be displayed and this will contain data from all devices.