The Dynamic Histogram Chart Component is a powerful data visualization tool that displays the distribution of data across different categories or bins. Histograms are particularly useful for showing frequency distributions, data density, and identifying patterns in data sets. This component works with various data sources and provides multiple configuration options to customize its appearance and behavior for optimal data representation.
showLegend - Determines whether the legend is displayed alongside the chart. When enabled, a legend with the data series name and corresponding color will be displayed, providing context for the histogram bars.
barPadding - Sets the padding between bars in the histogram, specified as a number between 0 and 1. For example, setting this to "0.5" adds moderate spacing between bars for better visual distinction.
barWidth - Defines the width of individual bars in the histogram, specified as a number. For example, setting this to "30" creates bars with a width of 30 pixels, allowing for control over the chart's density.
ignoreEmptyPoints - Determines whether empty or null data points are displayed in the chart. When enabled, gaps in the data are omitted rather than shown as zero-height bars.
argumentAxisTitle - Sets the title text for the horizontal (x) axis of the histogram. For example, setting this to "Age Groups" clarifies what the categories along the x-axis represent.
valueAxisTitle - Sets the title text for the vertical (y) axis of the histogram. For example, setting this to "Number of Customers" clarifies what the height of each bar represents.
paddingClass - Configures the padding around the component using CSS classes. For example, "p-4" adds substantial padding on all sides of the histogram component.
useMockData - Determines whether sample data is used instead of an actual data source. When enabled, the histogram displays pre-defined sample data, which is useful for design and testing purposes.
dataSourceId - Specifies the data source ID for retrieving histogram data. For example, "api/customer-age-distribution" connects the chart to an endpoint that provides the appropriate data structure for visualization.
getEntityCollectionHttpRequestParametersMap - Configures HTTP request parameters for fetching data. This allows for customizing query parameters, path variables, or body parameters that are sent when requesting data.
dataPathExpression - Defines the path to access the actual data array when the response has a nested structure. For example, "data.analysis.distribution" allows accessing deeply nested data structures.
id - Specifies a unique identifier for the component, useful for programmatic access in testing or custom code.
dataTestId - Sets a testing hook ID for automated testing, allowing test scripts to reliably identify this histogram component.
enableAsHotspot - Enables the component as a guided tour hotspot. When enabled, this histogram can be highlighted during onboarding tours.
guidedTourHotSpotTitle - Sets the title text displayed when this component is highlighted in a guided tour, with support for translations.
guidedTourHotSpotDescription - Sets the descriptive text explaining the histogram's purpose during a guided tour, with support for translations.
The Histogram Chart component expects data in the following format:
[
{ "category": "0-10", "value": 12 },
{ "category": "11-20", "value": 25 },
{ "category": "21-30", "value": 47 },
{ "category": "31-40", "value": 35 },
{ "category": "41-50", "value": 28 },
{ "category": "51-60", "value": 18 },
{ "category": "61+", "value": 9 }
]
The component will automatically use the "category" field (or equivalent as specified in configuration) for the x-axis labels and the "value" field for the height of each bar.
The Dynamic Histogram Chart component is commonly used for:
The component allows for extensive customization:
This flexibility makes the histogram adaptable to various data visualization needs while maintaining a clean and professional appearance.