Fix broken chart: Options for axis are extended correctly in the time series

Merged Miguel Rincon requested to merge 207070-metrics-anomaly-chart-rendering-fails into master

What does this MR do?

Fix for #207070 (closed)

Ensure the options for axis are extended in the time series

Upper chart component (e.g. anomaly) should be able to pass options to the time series without destroying the structure of original options.

This change added the xAxis and yAxis configuration to the options without replacing them completely, similarly to the series extension.

Background

The anomaly chart component is a wrapper for the time series component. The anomaly chart extends it by adding extra configuration to the regular time series chart, e.g. adding the boundary band, red dots and axis configuration.

When time series added a seconds axis in !24953 (diffs), switching from an single axis object to an array of axises, it broke the way the configuration was extended. This MR fixes this problem.

Screenshots

It works now.

image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #207070 (closed)

Edited by 🤖 GitLab Bot 🤖