Is it possible to create a goal line in ApexCharts?

5.9k views Asked by At

I am have a chart that displays a users weight and I would like to add a horizontal line (a goal line) at a specific weight that the user would like to reach.

Is there an option for this with ApexCharts?

1

There are 1 answers

0
Clancinio On BEST ANSWER

SOLVED

You can add horizontal or vertical lines by using annotations.

https://apexcharts.com/docs/annotations/

annotations: {
  yaxis: [
    {
      y: 20,
      borderColor: '#00E396',
      label: {
        borderColor: '#00E396',
        style: {
          color: '#fff',
          background: '#00E396'
        },
        text: 'Y-axis annotation on 8800'
      }
    }
  ]
}