score:1
Accepted answer
You can:
- use chart
redraw
event callback function and callsetExtremes
:
chart: {
events: {
redraw: function() {
if (allowChartRedraw) {
allowChartRedraw = false;
this.xAxis[0].setExtremes(0, Math.random() * 3);
}
allowChartRedraw = true;
}
}
}
Live example: http://jsfiddle.net/BlackLabel/wvpnct9h/
API Reference: https://api.highcharts.com/highcharts/chart.events.redraw
- keep all of the options in a state and manipulate axis extremes by
min
andmax
properties:
componentDidMount() {
this.setState({
chartOptions: {
series: [
{
data: [Math.random() * 3, Math.random() * 3, Math.random() * 3]
}
],
xAxis: {
min: 0,
max: Math.random() * 3
}
}
});
}
Live demo: https://codesandbox.io/s/highcharts-react-demo-jo6nw
- get the chart reference and call
setExtremes
on thexAxis
.
Docs: https://github.com/highcharts/highcharts-react#how-to-get-a-chart-instance
Source: stackoverflow.com
Related Query
- set Highstock xAxis range within options object
- Highcharts - set maximum range for yAxis but keep axis dynamic within that range
- How to set a minimum range in highstock navigator?
- Highcharts - set xAxis range when using xAxis Categories?
- Highstock set XAxis extreme without data
- Set highstock chart navigator max range by default
- Strange character in the Highstock source code
- Calculate Linear Regression based off data within range as opposed to full data set
- Unable to set xAxis min for Highstock (Highcharts)
- Highstock - Set extremes beyond the data range
- Which highstock options can I use to remove inbetween xAxis
- How to set xAxis only with time in Highstock step graph
- highstock chart only set the max value of xAxis
- Set a custom rangeSelector and disable xAxis label on chart and on Navigator with Highstock
- r - How to set xlim and ylim range in a highcharter plot?
- Trying to set a minimum height on bars in HighStock
- Set x-axis range in highcharts
- how to set a rangeSelector for highstock
- how to set xAxis pointInterval(update: tickInterval) in highcharts
- Highstock setExtremes with a custom range selector button
- How to set xAxis minimum and maximum values on Highstock?
- How to set default range selected on chart draw in Highcharts/Highstock
- Highcharts (Highstock) how to manually set the navigator selected range
- Adding vertical line on xAxis in HighStock
- Highcharts - highlight mouse position within a range
- Difference between highcharts and highstock during real time trace and xAxis with max value
- Set background color to HighChart xAxis labels
- Double X-axis within same Highchart object
- Highstock range approximation on spline series
- Get the currently selected range from RangeSelector in Highstock
More Query from same tag
- Highcharts tooltip format different with series
- Highcharts packed bubble chart not working for negative values
- How can i pass my data in sqlite database to templates? ( to make line chart using highcharts)
- Highcharts library UI glitches
- Remove 8pixel area that precedes xAxis values
- I'm getting a confusing legend in Highcharts (angular-highcharts)
- HighCharts title styles i.e textDecoration property not applying when we export the chart using canvg
- I was working on highcharts and react and want to built something like this with highcharts. Is it possible?
- How to enable/disable sections in Pie chart in Highcharts
- Highcharts metric prefix
- drawing two spline series with different number of values
- Line Chart using array
- Ionic3 Highcharts-More import Error --JsAllow Not Set
- TypeError: p is not a function while calling map function in angular 4 for fetching series for bellcurve highchart
- How to adapt a highstocks chart to a very narrow container?
- Highcharts Timeline inconsistent point width in multiple series
- Highcharts Selection Event Disable highlighting Effect
- Converting String value to int to be used within highchart
- How to sort objects by creation date to plug into high charts with Meteor
- HighCharts trouble with the x axis
- Plot aspect ratio
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- How to display plotlines when only one value exists
- How to set y-axis in HighChart?
- Click event on clicking on the graph
- Send data from Python backend to Highcharts while escaping quotes for date
- Highcharts creates same text 3 times
- Pie chart -custom event for legendItemClick-highchart
- Highcharts: How to set colors per column, per series, with a data set, in a multi series chart?
- Highcharts, add icon to plotline?