How to make annotation take up full width of Chart (ApexCharts.js)

1.6k views Asked by At

I have added the annotation option to my chart but it does not take up the full width of the chart. The annotation does not go all the way to the start or end of the chart, there is a space. I can't find any option for width in the documentation. Any suggestions??

annotations: {
  yaxis: [{
    y: 8.5,
    borderColor: '#39cc3e',
    label: {
      borderColor: '#00E396',
      style: {
        color: '#fff',
        background: '#39cc3e'
      },
      text: 'Sleep goal'
    }
  }]
},
1

There are 1 answers

0
Julien Ehrhart On

You can use a negative offsetX to move it to the left and extend it with width to reach the right border.

YAML config equivalent:

  annotations:
    yaxis:
      - 'y': 70
        borderColor: '#000'
        strokeDashArray: 2
        offsetX: -11
        width: 110%