---
title: "Charting averages, totals and counts by field"
date: 2026-07-24
author: "Rafael Bennemann"
link: "https://www.gravitykit.com/docs/gravitycharts/charting-averages-totals-and-counts/"
---

A chart does not have to count entries. It can show the average, total, highest or lowest value of one field, grouped by the choices of another. That is how you get a chart comparing revenue per region, average score per department, or totals per reporting year.

## What you need on the form

Two fields:

- A **choice-based field** to group by, such as a Drop Down, Radio Buttons or Checkboxes. Each choice becomes a bar or a slice.
- A **field holding the numbers**, usually a Number field.

**Note**: A Number field cannot be the field you group by. If you want to group by something like a year, store it as a Drop Down rather than as a number.

## Set up the chart

- Go to *Forms*, hover the form, then *Settings* → *GravityCharts*, and click *Add New*.
- Name the chart and pick a chart type. Bar / Column suits most comparisons.
- Leave **Data Type** on “By Field (Default)”.
- Set **Data Source** to the field you want to group by.
- Set **Data Operation** to the calculation you want.
- Set **Data Field** to the field holding the numbers.

![Chart Data panel configured to average the Revenue field grouped by the Reporting Year field](https://www.gravitykit.com/wp-content/uploads/2026/04/01-chart-data-by-field.png)

## The available operations

| Operation | Shows |
|---|---|
| Entry count | How many entries fall into each choice. No Data Field needed. |
| Sum values | The total of the Data Field for each choice. |
| Average values | The mean of the Data Field for each choice. |
| Maximum value | The highest single value in each choice. |
| Minimum value | The lowest single value in each choice. |

## The result

A form collecting annual business metrics, with a Reporting Year drop down and a Revenue number field, produces one bar per year showing that year’s average revenue. That is a year-over-year comparison with no date field involved.

![Chart preview showing average revenue for 2025 and 2026 as two bars, with the Colors, Design, Title and Legend, Axis and Labels tabs above it](https://www.gravitykit.com/wp-content/uploads/2026/04/02-chart-configuration-five-tabs.png)

## Narrowing what the chart includes

Conditional Logic on the chart limits which entries are counted, so you can chart one region or one status without building a separate form. Filters are applied when the feed is saved rather than in the live preview.

Charts placed inside a View with the GravityCharts widget can instead follow the View: the widget can chart all of the View’s entries, or only the entries currently shown on the page, so a visitor’s search narrows the chart with it.

## When to use a timeline instead

Group by a date rather than by a field’s choices when you want a trend over time, using a Date field on the X axis. See [Plotting data against time](https://www.gravitykit.com/docs/gravitycharts/plotting-data-against-time/).