Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To reduce the length of a plot line in Highcharts that was included using the addPlotLine function, you need to update the value of the plot line using the update method. You can use the id or index of the plot line to update it. For example, to reduce the length of the plot line with id 'myPlotLine', you can use the following code:

chart.xAxis[0].update({
  plotLines: [{
    id: 'myPlotLine',
    value: 5, // set the new value of the plot line
    width: 2, // set the new width of the plot line
    color: 'red' // set the new color of the plot line
  }]
});

In this example, we update the value of the plot line to 5, which will effectively reduce its length. We also set the new width and color of the plot line as needed.