score:0
I tried to assign an id to plotLine,
First remove the plotline completely by removePlotLine(id)
, then added it back by addPlotLine
. It works great for me.
function upgradePlotLine(new_line) {
chart.yAxis[0].removePlotLine('my_line');
chart.yAxis[0].addPlotLine(new_line);
}
score:1
Here's what worked for me http://jsfiddle.net/tx1kt0bj/2/
var plotBand = tempAxis.plotLinesAndBands[0];
$.extend(plotBand.options, {
color: '#000',
to: 10,
from: 2
});
plotBand.svgElem.destroy();
plotBand.svgElem = undefined;
plotBand.render();
score:3
just add this code and then you can use the plotline.update method
//Add support for update method
Highcharts.PlotLineOrBand.prototype.update = function (newOptions){
var plotBand = this;
Highcharts.extend(plotBand.options, newOptions);
if (plotBand.svgElem) {
plotBand.svgElem.destroy();
plotBand.svgElem = undefined;
plotBand.render();
}
}
score:5
You can only destroy and create new plotLins, because update() function is not available.
Source: stackoverflow.com
Related Query
- Highcharts dynamically add/change yAxis plotLines
- How do I dynamically change the yAxis min, max and tickInterval in HighCharts
- Does HighCharts have an option to dynamically add plotLines to xAxis via datetime?
- Highcharts generated from HTML table: Can't add second yAxis dynamically
- How do I dynamically change a data point in Highcharts using JavaScript
- Highcharts dynamically change bar color based on value
- HighCharts Dynamically Change Chart Type
- Highcharts add series dynamically
- Highcharts: Dynamically change / add axis attributes
- Dynamically add data to series in Highcharts
- Highcharts - How do I dynamically change Marker radius when zooming?
- HighCharts - Dynamically Change Axis Title Color
- highcharts change rendered image source on click
- Highcharts plotLines with multiple xAxis and yAxis
- How do i add mouse wheel code in Angular2 highcharts in typescript
- Add data dynamically to the top level in highcharts when drilling up
- How to change space value between grid and yAxis in Highcharts line chart
- Highcharts area range series change plotting area dynamically
- Highcharts colorAxis - Hide or add dynamically
- Need to dynamically add menuItem to HighCharts contextButton w/function defined by variable
- Spark - Highcharts // Add points dynamically
- Highcharts low performance when adding yAxis dynamically
- Dynamically add an event to Highcharts series
- highcharts change exporting option dynamically
- Pie chart Slice color Change Dynamically in Highcharts
- Highcharts large treemap how can I dynamically change allowDrillToNode flag?
- highcharts change series color when data is dynamically inserted
- How to change the line color of a bubble in highcharts dynamically
- Highcharts - Dynamically change chart type with on radio buttons click
- Add Source to Highcharts Export CSV
More Query from same tag
- Highcharts export charts as image on serverside with php
- Function to call Highcharts with ajax?
- Can we disable zoom on highchart graph while graph is loading
- Just how flexible is highcharts? (Mockup attached.)
- highcharts - 2 date picker questions
- Generic HighCharts (Javascript\Java)
- How do you add to tooltip, a series in HighCharts?
- Removing hh:mm:ss from PHP's strtotime function
- Creating graph on webpage using Highcharts
- HightChart Error 13 with angular js, function and controller scope
- HighCharts round down when over 100
- how to set negative axes intervals in highcharts
- Remove [Object] label in highchart
- HighCharts not rendering on Polymer page
- Combination of ohlc and line plot in highchart
- TypeError: null is not an object (evaluating 'b.body') - Highcharts/wkhtmltopdf
- Override default highlighting on hover in networkgraph
- set left and right margin in highchart
- Highcharts Gantt (JS) - Remove the day in x axis
- Add Local HTML and JS file using React Native Webview
- Data parsing from mysql into highchart with json
- Implements live highcharts in ionic 2
- Custom legend in rCharts (highcharts)
- The point's gap affects the width of columns of highcharts. Bug?
- How do you call a programmer-defined function in javascript in an android webview?
- Highcharts - Suppress points being dragged on drag event
- Nested Donut chart with margins
- High Charts Data Table not filtering data by range selector
- Highcharts missing first date label on xAxis
- Highcharts double y axis constant 0 value on both sides