score:0
Accepted answer
I've wanted to use the Shift key for zooming, so this is my solution
$('#container').highcharts('StockChart', {
chart: {
//zoomType: 'x', // we declare it without zoom, so the pan is enabled
// ...
}});
var chart = $('#container').highcharts();
chart.pointer.cmd = chart.pointer.onContainerMouseDown;
chart.pointer.onContainerMouseDown = function (a){
//in my case, I need only X zooming, so I enable it if shift is pressed
this.zoomX=this.zoomHor=this.hasZoom=a.shiftKey;
this.cmd(a);
};
seems to work ok, so hope it help you
here is a JSFiddle working example: http://jsfiddle.net/73bc23zq/
score:3
You can try with selection event:
chart: {
...
events:{
selection: function(event) {
if (lastButton == 1)
event.preventDefault();
}
}
}
Source: stackoverflow.com
Related Query
- highcharts panning
- Panning in Highcharts will not allow to go back to the max of the xAxis
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Highcharts - Global configuration with common code and unique data & Headings
- HighCharts Stock Chart error code 18
- highcharts change rendered image source on click
- How do i add mouse wheel code in Angular2 highcharts in typescript
- how to display 2 same highcharts without duplicate the code
- Use of DotNet HighCharts dll to make charts in code behind
- How to edit tooltip in Highcharts C# code
- what means ${demo.css} in example files of highcharts ? That piece of code seems to be literal
- passing json values to highcharts from .net code behind
- how to use highcharts tooltip formatter in python code
- passing formatting JavaScript code to HighCharts with JSON
- Catch panning event in Highcharts
- Highcharts display label for pie chart using html table as data source
- Simple, Open source PHP wrapper for Highcharts library
- Add Source to Highcharts Export CSV
- Include additional highcharts source data in angular2 app
- Conditions within highcharts code
- Strange character in the Highstock source code
- What's the code in Highcharts such that the bars (columns) in the same group use the same color?
- Highcharts series visibility with csv data source
- HTML table as data source for highstock charts using highcharts
- Including source for Alchemy js breaks Highcharts js
- Panning in Highcharts (In Mobile Devices)
- Highcharts SVG Export from Python Server Side Code
- Is there any panning facility working with zoom for highcharts
- How to have multiple highcharts with different series data in vuejs without repeating code
- Converted PHP code that built an array to JS and now highcharts doesn't work - what did I do wrong?
More Query from same tag
- Highcharts inverted line where dates go upwards, not downwards (reversed series)?
- Angular-highcharts pushing data from api into highchart option
- Select which chart data category to show versus omit
- Why highstock charts have two yAxis?
- Use django variable (array of elements from sqlite3 database) inside javascript embedded code
- How to add a label above each bar in HighCharts
- Issues Rendering Highcharts - Populating through PHP/MySQL
- Is there a way to color boxplots based on group in hcboxplot()?
- Append React Highchart with Annotations after initial load of chart
- Highcharts Grouped Column Chart with Multiple Groups?
- Highcharts: completely custom label positions on x-axis
- Highcharts - Update a series point [x,y] values?
- Highcharts 5 tooltip colour with custom css class
- Highchart issue when added into bootstrap carousel
- High charts not showing all the values on X-asix
- Is there a way to plot more than 1000 points in a scatter plot using the Highcharts .NET Wrapper?
- Relative percentage height not showing properly
- Highcharts marker after plotline
- Why doesn't HighCharts render when I pull it in with Ajax?
- Highcharts How to add data label to last data point of a series
- Highstock Single Navigator for multiple Charts
- HighCharts Stacked Charts xAxis with json not working
- How to access y - data in stack column after one of the legend is pressed/removed?
- Highcharts: How to display multiple tooltips by click in multiple series with shared true
- How to properly structure/pass in data for Highcharts.js series chart?
- HighCharts Plotlines with Multiple Y-Axis
- Syntax to create a heat map with Highcharts
- Display Data with Xvalues correctly in Highcharts
- Use String as object in javascript?
- MySQL query from different databases in time to output in one graph