Skip to content

Annotations don't split to specific scale on stacked chart #665

@chedvacohen

Description

@chedvacohen

Hi,
I use chartjs-plugin-annotation to draw box annotations on stacked chart.
According to the documentation I added the property yScaleID to each box annotation in accordance with the related scale id.
I expected that the annotations position will be only on the specific scale, but the reality is that the annotations ״smeared״ on all scales from top to bottom.
The creation of the annotation is done as follows:

 const annotation = {
      type: 'box',
      xMin:"2022-01-26T02:00:00",
      xMax:"2022-01-26T16:30:00",
      yMin:undefined,
      yMax:undefined,
      backgroundColor:"#FFF2B2",
      drawTime: 'beforeDraw',
      borderWidth: 0,
      yScaleID:'y'
}

Note that I set the properties yMin and yMax to undefined in order the box will be painted on the entire height of the  scale.
Result:
image

Expected result:
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions