score:1
Accepted answer
You can overwrite Highcharts.Annotation.prototype.onDrag
method:
(function(H) {
H.Annotation.prototype.onDrag = function(e) {
if (
this.chart.isInsidePlot(
e.chartX - this.chart.plotLeft,
e.chartY - this.chart.plotTop
)
) {
var translation = this.mouseMoveToTranslation(e),
xAxis = this.chart.xAxis[0],
step = 0.5,
pxStep = xAxis.toPixels(step) - xAxis.toPixels(0);
if (!H.defined(this.potentialTranslation)) {
this.potentialTranslation = 0;
}
this.potentialTranslation += translation.x;
if (Math.abs(this.potentialTranslation) >= pxStep) {
translation.y = 0;
translation.x = (this.potentialTranslation > 0) ? pxStep : -pxStep;
this.potentialTranslation = 0;
if (this.points.length) {
this.translate(translation.x, translation.y);
} else {
this.shapes.forEach(function(shape) {
shape.translate(translation.x, translation.y);
});
this.labels.forEach(function(label) {
label.translate(translation.x, translation.y);
});
}
}
this.redraw(false);
}
}
}(Highcharts));
Live demo: http://jsfiddle.net/BlackLabel/vmon2chx/
Source: stackoverflow.com
Related Query
- Highcharts draggable annotaion how to move by steps?
- Highcharts Bubble Chart - How to move an individual point's data label (dataLabel) to the front/top
- Highcharts : How can i move the tooltip to external DIV?
- How do i add mouse wheel code in Angular2 highcharts in typescript
- how to display 2 same highcharts without duplicate the code
- How to edit tooltip in Highcharts C# code
- how to use highcharts tooltip formatter in python code
- how to animate the move of a point from a position to another in a HighCharts scatterplot
- How to move the legend in Highcharts
- How do I get Highcharts chart redraw to move faster?
- How can I move columns to the right in a Highcharts chart?
- How to have multiple highcharts with different series data in vuejs without repeating code
- Highcharts column how to move series name to the title position with bigger text size
- How to move point's label and SVGs by moving a point graphic in highcharts gantt?
- How to modify the code so that Highcharts graph does not cover fixed navigation bar at the top of the page?
- how do i link my sqlite(PDO) databse data to highcharts code
- How can I convince Highcharts to display the right (mine) steps on yaxis?
- How can I use highcharts draggable plotline as video timeline (vice versa)
- how can I use rangeselector and navigation in highcharts in the given code
- How to change code in "Pie Chart" in HighCharts
- Highcharts - How do I move an icon inside each pie slice when the pie slice moves on hover?
- How to get highcharts dates in the x axis?
- How to create a column range chart in Highcharts using range and navigator functions?
- How to remove button from Highcharts
- How can I get access to a Highcharts chart through a DOM-Container?
- HighCharts - How can I turn off the points?
- How do you change the colour of each category within a highcharts column chart?
- How to set Highcharts chart maximum yAxis value
- How to modify highcharts legend item click event?
- How can I change the colors of my highcharts piechart?
More Query from same tag
- Highcharts: Column and Bar Chart labels are incorrect when I drilldown
- Pass a textfield value from php to javascript
- Highcharts: How to remove tiny space between stacked bars/columns
- Highcharts combination chart: how to put lines above columns (shift/offset)
- Add stacked border color in Highchart?
- Title of highchart rendering bad
- Area Stacked linewidth
- Render Highchart with dynamic ID in jQuery tooltip
- Highcharts multi line graphs
- Highcharts. Series have same color after drilldown
- Highcharts error csv.replace is not a function
- How to change format of the upper xAxis Label?
- How to move islands in a highmap
- AngularJS $resource caching with deferreds
- How to dynamically set title in Pie Chart of Highcharts
- GWT Highcharts calling Javascript using JSNI
- Adding tooltip to legend in highcharts
- Highcharts pie with strokes
- Set ID to div and show the div after clicking a button using jquery
- Highcharts Compare Date Ranges Bar Chart
- 3D Scatter chart scrolling if I scroll the scrollbar
- Highcharts animation with color blending
- Highchart basic bar : How to know which specific bar section is clicked?
- Highcharts: bar/column chart label position with values of 0
- Show average in highcharts graph as column
- change highcharts detetime label
- Having Highcharts directive how to get/change current path onClick event?
- tooltip formatter Highcharts not work with Firefox ? - Bug?
- In highcharts,series without dynamic data does not shift
- Dynamically set click event on bar from highcharts graph