Ask Your Question
2

What is the method to reduce the length of a plot line in Highcharts that was included using the addPlotLine function?

asked 2022-04-04 11:00:00 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-05-14 19:00:00 +0000

qstack gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-04-04 11:00:00 +0000

Seen: 10 times

Last updated: May 14 '22