how can i add plot options dynamically in angular data?

You can make it dynamically, there are a few steps which you need to fallow:

  1. Create the reference to the chart by using the chart callback function
chartCallback: Highcharts.ChartCallbackFunction = chart => {
    this.chartRef = chart;
};
  1. Add addPlotLines method to the App and invoke that function in the chart load event.
  2. In the addPlotLines method use reference and the axis update method add the plot lines. You might add some conditions here or loop through the data in a search for some points.

API:
https://api.highcharts.com/highcharts/chart.events.load
https://api.highcharts.com/class-reference/Highcharts.Axis#update
Demo:
https://stackblitz.com/edit/highchart-highstock-2o9wdh

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top