Navigation
This documentation refers to the on-premises edition of MongoDB Charts. Read the Atlas service documentation to learn how to use MongoDB Charts with your Atlas project.

Field-Level Options

Within the customization tab, you can modify how MongoDB Charts displays data fields in your visualization. The customization options available depend on the data type of the value you are customizing.

Field level customizations

Field Label Override

When you encode a field in the Chart Builder, MongoDB Charts automatically generates a label for the field in the visualization. Charts generates the label based on the field name and the type of aggregation applied to the field if appropriate. You can use this customization option to override the default label to provide more insightful or descriptive field labels.

To override a field label:

  1. Navigate to the Customization tab in the Chart Builder.
  2. Click the field whose label you wish to modify to expand its customization options.
  3. Set the Label Override toggle switch to On.
  4. Enter the new desired field label in the text box.

This option affects all places in the chart the field label appears, including axis titles, legends, tooltips, etc. Your chart automatically updates to show the new label. This option is available on all chart types.

Number Formats

You can use these customization options to specify how Charts formats numbers in your data fields. These options are available on all chart types.

Number Format Options

MongoDB Charts provides the following options for formatting numbers. You can use any combination of these options to customize your chart:

Option Description
Decimals Specifies to how many decimal places Charts rounds each data value or label. If you specify this option, Charts displays all values with the specified number of decimal places, either by rounding decimals or adding zeroes to whole numbers. If you do not specify this option, Charts displays values in their original form with no modifications.
Multiplier Specifies a number by which Charts multiplies each data value or label. This option is useful for scaling data, such as showing values in terms of thousands or millions. You can also use this option to convert measurements or currencies to different units by multiplying your values by the appropriate factor.
Prefix Specifies a string which Charts prepends to each data value or label. This option is useful for formatting currencies by prepending characters such as $ or .
Suffix Specifies a string which Charts appends to the end of each data value or label. This option is useful for providing context to your data by appending units, such as °F or km/h.

Number Format Presets

Charts provides the following preset customizations to format numbers for common use cases:

Option Description
Percentage Multiplies each value by 100 and appends a % sign to each value. Use this option to convert decimal values to percentages.
Dollars Rounds each value to two decimal places and prepends a $ to each value.
Thousands Divides each value by 1,000 and appends a K to each value.
Millions Divides each value by 1,000,000 and appends an M to each value.

If you select a preset, you can modify any of its attributes to further refine your numeric displays. Once you modify a preset’s attribute, Charts changes the preset selection in the dropdown to Custom.

Date Format and Time Zone

You can customize how MongoDB Charts displays date fields, as well as convert dates to a specified time zone.

Date Field customizations

To customize date formats and configure time zones:

  1. Navigate to the Customization tab in the Chart Builder.
  2. Click the field whose date format and time zone you wish to modify.
  3. Configure the Date and Time Formatting and Convert Time Zone settings as desired.

Date and Time Formatting

Use this option to specify how Charts formats dates and times. Click the dropdowns in this customization section to select a preset format provided by Charts. Charts provides one dropdown for selecting a date format and one dropdown for selecting a time format.

Note

Depending on the binning type selected for the field, Charts may not show both date formatting dropdowns. Also, the options in the dropdowns change depending on the binning type selected.

For more information, see the Considerations section.

You can also use the input box below the dropdowns to specify a custom datetime format. The following table shows how to create custom datetime formats:

Symbol Meaning Example
YYYY Full year. 2018
YY Last two digits of year. 18
MMMM Full month as letters. November
MMM Abbreviated month as letters. Nov
MM Month as numbers, with leading a zero if applicable. 08
M Month as numbers with no leading zero. 8
DDDD Day of the year, with leading zeroes if applicable. 076
DDD Day of the year with no leading zeroes. 76
DD Day of the month with a leading zero if applicable. 05
D Day of the month with no leading zero. 5
HH Hour with a leading zero if applicable. Uses 24-hour time format. 18
H Hour with no leading zero. 8
A Adds the applicable AM or PM period to the format. Uses 12-hour time format. PM
mm Minute with a leading zero if applicable. 03
m Minute with no leading zero. 3
ss Second with a leading zero if applicable. 09
s Second with no leading zero. 9

Example

Consider a timestamp of November 8th, 2018 1:30:58 PM. The following table shows how various custom date filters would output the date:

Custom Format Output
YYYY/MM/DD 2018/11/18
MMM YY Nov 18
DDD, YYYY HH:mm:ss 322, 2018 13:30:58
DD-MMM H:mm:ss A 08-Nov 1:30:58 PM

Once you modify a preset’s attribute, Charts changes the preset selection in the dropdown to Custom.

Considerations

If you bin your timeseries data, you cannot specify a unit of time in your custom format with smaller granularity than your bin size. For example, if you bin data by Month, you cannot specify days, hours, minutes, or seconds in your custom format because Charts does not show these values in the visualization. If you enter an invalid custom datetime format, Charts highlights the format input box in red.

Specifying the Periodic option further limits valid formatting options. For example, if you bin data by Month, you can only specify year in your date format if you disable the Periodic option. If you enable the Periodic option, you cannot specify year because Charts only displays the month in the field.

Convert Time Zone

By default, MongoDB Charts displays timeseries data exactly how it appears in the original dataset, which is assumed to be in UTC. You can use this customization option to convert the time zone in which Charts displays the data to best fit the location of the data or the viewers of the chart.

To enable this option:

  1. Set the Convert Time Zone toggle switch to On.
  2. Use the dropdown below the toggle to select the desired time zone for your data.

Note

When you convert time zones, Charts automatically accounts for Daylight Savings Time when required.

You can search the dropdown to easily filter for the desired time zone. Type into the search bar above the dropdown to see all matching time zones.