There is no built-in setting in Mendix charts to automatically show missing months with value 0. The chart only displays the data points that exist in its datasource.
Because of that, the usual solution is to prepare the dataset before sending it to the chart. If a month has no data, you must still include that month in the datasource with value 0.
A common approach is to use a helper entity or a datasource microflow. In that logic, you generate all months for the selected year and then match the existing records. If a month does not have data, you create a record with count = 0.
So the dataset returned to the chart should already contain all months. For example:
Jun 2025 = 2
Jul 2025 = 1
Aug 2025 = 0
Sep 2025 = 3
Oct 2025 = 0
Nov 2025 = 1
Once the chart receives a complete list including the months with zero values, the X-axis will show all months correctly.
If this resolves your issue, please mark the answer as accepted so it can help others in the community as well.
Hi,
In Mendix Charts (Line / Bar / Pie widgets) there is no built-in setting to automatically show missing categories with value 0. The chart only renders data that exists in the dataset returned to the widget. So if August or October does not exist in the returned list, the chart simply skips those months.
Because of that, the correct solution is not a chart setting, but preparing the dataset before sending it to the chart so that all months exist with value 0 when no data is found.
Below is the standard approach most Mendix developers use.
Example entity:
ChartMonthlyData
Attributes:
Month (String or Enum)Year (Integer)Count (Integer)This entity will be used to build the dataset sent to the chart.
Example microflow:
MF_GetMonthlyChartData
Steps:
Step 1 – Create a list containing all 12 months
Loop from 1 → 12 and create objects like:
Month | Count |
Jan | 0 |
Feb | 0 |
Mar | 0 |
... | ... |
Dec | 0 |
So initially all months already exist with Count = 0.
Step 2 – Retrieve actual data
Retrieve your real data from database.
Example:
SELECT Month, COUNT(User) GROUP BY Month
Or retrieve entity records filtered by the selected Year.
Step 3 – Update the month values
Loop through the real data and update the matching month object.
Example logic:
For each RetrievedRecord
Find MonthObject in MonthlyList
ChangeObject:
Count = RetrievedRecord.Count
Now months without data will remain 0, and months with data will have their correct count.
Set the chart Data source = Microflow
Use the list returned by MF_GetMonthlyChartData.
Configure:
Category (X-axis) → Month
Value (Y-axis) → Count
Even if the database contains:
June = 2 July = 1 Sep = 3 Nov = 1
The dataset sent to the chart will be:
Jan 0 Feb 0 Mar 0 Apr 0 May 0 Jun 2 Jul 1 Aug 0 Sep 3 Oct 0 Nov 1 Dec 0
So the chart always shows all months, and missing months automatically display 0.
This behavior is expected because Mendix Charts simply visualize the dataset they receive. They do not generate missing categories automatically.
So the correct Mendix approach is to prepare the data in a microflow before sending it to the chart.
If you want, I can also show you a clean microflow structure used in production Mendix apps for monthly charts (very optimized for performance).