score:30
Accepted answer
You can use the setExtremes function to change the zoom. http://jsfiddle.net/quVda/382/
For a timeseries chart with day-by-day information, you need to use the UTC representation of the date:
var d = new Date();
chart.xAxis[0].setExtremes(
Date.UTC(d.getFullYear(), d.getMonth(), d.getDate() - 7),
Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));
score:0
There is another option if you try
var max_in = 100; //the highest y value you have in your series data;
var min_in = 41 ;//the lowest y value you have in your series data;
yaxis=this.yAxis[0];
yaxis.options.max = max_in;
yaxis.options.min = min_in;
score:5
Updated official fiddle for solution, guys: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/stock/members/axis-setextremes/
$(function() {
$('#container').highcharts('StockChart', {
rangeSelector: {
selected: 1
},
series: [{
name: 'USD to EUR',
data: usdeur
}]
});
$('#button').click(function() {
var chart = $('#container').highcharts();
chart.xAxis[0].setExtremes(
Date.UTC(2007, 0, 1),
Date.UTC(2007, 11, 31)
);
});
});
Source: stackoverflow.com
Related Query
- Automatically zooming in on highcharts after loading
- Highcharts loading animation after setdata
- Highcharts chart not loading after AJAX call to insert partial containing chart
- Highcharts visualizes chart data incorrectly after zooming or using the navigator
- highcharts how to have loading animation after data update?
- I want to add a loading spinner or add some dialog until highcharts get loaded and should close after chart is loaded in react typescript?
- y-axes misaligning in highcharts after zooming in
- Python: Read data from Highcharts after setExtreme
- Loading Highcharts via shim using RequireJS and maintaining jQuery dependency
- Loading Highcharts with require.js
- Highcharts How to Show Loading Animation At Set Data
- Get Highcharts Series Data after Load
- Change Highcharts tooltip formatter from chart Object , after chart is rendered
- Highcharts 'Reset Zoom' after calling setExtremes
- Automatically join missing data gaps in Highcharts JS
- Loading several large dataset in Highcharts
- Execute function after zoom highcharts
- Highcharts bars are half missing after drillup
- Loading multiple Highcharts with jquery.load
- Render Highcharts after user updated labels
- highcharts organization chart is throwing error when loading module
- Highcharts - Updating a chart's option after initial render
- Loading Highcharts series from XML using jQuery
- Highcharts loading image
- HighStock chart.rangeSelector after loading
- Bug in Highcharts after exiting the full screen mode
- How to add new points to highcharts after plotting the first 'n' points?
- highcharts piechart redraw with animation after setData()
- Highcharts zoom issue after upgrading to jQuery 1.8
- Highcharts Beta 3: Best Practice loading JSON data
More Query from same tag
- HighCharts remove $ and % symbols from custom html table when creating graph
- Getting Highcharts tooltip to return an angular directive using templeteUrl?
- Highcharts Stock Chart, Series Padding?
- HighChart Tooltip Position can be changed?
- Highcharts yaxis higher values displayed lower
- how to make chart real time with 2 line and get data from php with highcharts
- how do i link my sqlite(PDO) databse data to highcharts code
- Set a maximum for data grouping in Highstock charts to prevent from grouping
- Keeping the x axis interval fixed highstock
- HighCharts Js graphs in loop
- HIghstock Timeseries data date format
- Add vertical(projection) line from point to categories, highcharts
- Highcharts - Guage - Changing the color and radius of the center black dot(circle)
- stacked bar chart shows hanging zeros when all values are 0 highcharts
- Export Multiple Highcharts to Multi-page PDF
- Extend highcharts renderer symbols to have plus sign
- Highcharts- how to set yAxis to the closest or exact value in the series data
- Python: How to transform DF into Json series?
- Highchart and DWR Comet
- Highcharts Stacked Column chart change legendItemClick function
- Highstock tooltip Formatter not able to display extra data
- Highcharts Line Chart Drill down not working properly
- How to make Column type series Secondary yAxis values dynamic and not always start with 0?
- Want to avoid spacing between each stacked bars in highcharts?
- Highcharts stacked data, stock like chart
- Generate pdf on the fly with charts
- highcharts.js: static ticks spaced equally apart
- Semi circle donut chart in highchart with data labels in corners
- Printing from Highcharts returns focus to the top of the page
- Issue removing and readding series to chart