AG Studio Launch Week 🚀🚀🚀 28 Sep - 2 Oct 2026 🚀🚀🚀 Join now

Angular ChartsDevelopment Validation

Version 14.2.0

AG Charts reports option misconfiguration and caught runtime errors. Reports go to the browser console or a development overlay, the chart can throw to halt execution, and an event can be raised for each issue.

Severity Levels Copy Link

Each validation issue is reported as one of three severities: error, warning, or deprecation.

consoleOn, showOverlayOn and throwOn each take an array of one or more of these severities, and apply only to the ones listed. An empty array disables that option entirely.

The issueRaised event reports every issue and includes a severity property in the parameters.

Validation Overlay Copy Link

The overlay is opt-in and intended for development. Enable it by using validations.showOverlayOn and providing the severity levels desired.

{
    validations: {
        showOverlayOn: ['error', 'warning'],
    },
}

In this example:

  • Any errors or warnings present would be shown in the overlay, but deprecations would not, since showOverlayOn only lists 'error' and 'warning'.
  • Issues are grouped and sorted by severity, with a count in each group's heading.
  • Each issue shows a message with relevant information to enable easy debugging.
  • There is a Copy button for pasting into a bug report and dismissing the overlay hides it without suppressing future issues.
  • While shown, the validation overlay takes priority over the loading and no-data overlays.

Console Output Copy Link

Validation issues are written to the browser console by default. Use validations.consoleOn to change which severities are logged, or provide an empty array to disable console output entirely.

{
    validations: {
        consoleOn: ['warning'],
    },
}

In the above example:

  • Applying the invalid option with consoleOn: ['warning'] selected logs a warning to the console.
  • Applying it with consoleOn: [] selected logs nothing.

Throwing on Validation Issues Copy Link

Use validations.throwOn to make the chart throw an exception and fail-fast, instead of warning and falling back to a default. This suits automated workflows (for example, end-to-end test runs or AI-assisted development) where a hard failure should be surfaced for immediate attention.

{
    validations: {
        throwOn: ['warning'],
    },
}
  • Issues can arise at any point, not just when the chart is created, so a throw may interrupt an update part-way and leave the chart in an inconsistent state. Use throwOn during development only, never in production.
  • Console output still follows consoleOn and is never suppressed by this option.

Issue Raised Events Copy Link

Subscribe to the validations.issueRaised event to programmatically handle validation issues, for example to log them to a custom system.

{
    validations: {
        issueRaised: (event) => console.log(event),
    },
}

In this example:

  • The issueRaised event is logged to the console when invalid options are applied.
  • Unlike consoleOn, showOverlayOn, and throwOn, issueRaised is not filtered by severity.

API Reference Copy Link

Configuration for how the chart reports invalid configuration and runtime issues.

consoleOn AgChartValidationSeverity[] default: ['error', 'warning', 'deprecation']
The severities to write to the browser console.
showOverlayOn AgChartValidationSeverity[] default: []
The severities to report in an overlay on the chart itself.
throwOn AgChartValidationSeverity[] default: []
The severities that cause the chart to throw instead of warning and falling back to a default. Console output is never suppressed by this option.
issueRaised Function default: undefined
Called for each validation issue the chart raises.