Pie Chart

The Pie Chart block displays proportional data across one or more devices. In the example below, the chart illustrates the success rate of an industrial process over a 24-hour period.

Pie Chart

Configuration

Configuration of the Pie Chart is broken up into several sections.

Data Type

Data Type

The Pie Chart can display points as a live stream (re-rendering the chart every time a data point hits the platform) or as a historical chart. Each style has its own advantages:

  • Live stream charts provide feedback with more immediacy than historical charts, as they do not require a dashboard data refresh to populate with new data. If one of the block’s segments references multiple devices by ID or tag, the block will update anytime any of those devices reports state for the chosen attribute. For this reason we recommend one device per segment when building live stream blocks.
  • Historical charts allow for data to be aggregated according to a number of rules (based on time durations, mathematical functions and the combination of data from multiple sources), and they also allow for viewing past dashboard states.

Duration

Next, choose a Duration of time that the block’s data segments should cover. Select “Last received data point” to always return the last point matching each segment query, or any time period up to 180 days to return aggregated data within that time period. (This option is removed when “Live Stream” is selected for the block’s data type.)

Pie Duration

Number Formats

Optionally, provide a Value Format and a Percent Format for how each is displayed in the chart per segment, respectively. Each input takes a D3 format string for how to represent the data.

Pie Chart Number Formats

Block Data

Finally, define multiple segments to be compared against one another in the chart, with each segment representing a region on the chart. Each segment takes the following parameters:

Pie Block Data

  • Device: A device query for selecting one or more devices whose aggregated data should be returned for the segment.
  • Attribute: The attribute whose value should be returned. Depending on the chosen aggregation method, the selected attribute may have to be of the “Number” type.
  • Aggregation: The aggregation method to apply to the raw points returned by the segment. This may not be applicable depending on the block data type, duration, or number of devices returned.
  • Series Label: The label to use for this segment.
  • Color: The color to apply to the segment of the pie chart.
  • Expression: (optional) An expression to apply to the raw returned data, which can be used to transform the result that is applied to the segment. If an invalid expression is provided, the data point reverts to its raw value. In addition to the default render context, the following variables are available within the expression …

    • {{value}}: The raw value of the data point.
    • {{time}}: The time of the corresponding data point in milliseconds since Epoch.
    • {{ctx.VARIABLE_NAME}}: The value of a given context variable.

Was this page helpful?


Still looking for help? You can also search the Losant Forums or submit your question there.