Skip to content

feat: Add annotations config

Dhiraj Bodicherla requested to merge add-annotation-configs-creator-method into master

Summary

New feature

This MR introduces annotations for line and area charts. However, as of %12.10 only annotation lines are supported and not annotation ranges.

What else changed

The existing method to generate markAreas and markLines for thresholds have been updated to be more generic and to work alongside annotations.

Existing thresholds formats will continue to be supported:

{
  threshold: 345,
  operator: '>' // '<' // '&lt; // '&gt;'
}

The new format for annotations is as follows

{
// This will generate a line at 20
  min: 20,
  max: 20
}

The reason the format is set is so that it can be eventually used for annotation ranges which would run between min and max value.

Note 1: Annotation lines use blue500 but the values are incorrect for now. !1237 (merged) will fix the incorrect values.

Screenshots

Storybook > Charts > area-chart > with annotations and Storybook > Charts > line-chart > with annotations

header Area Chart Line Chart
Annotation lines image image

Mentions gitlab#211418 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports