score:1
First of all - it seems that you missed importing the broken-axis
module.
import HighchartsBrokenAxis from "highcharts/modules/broken-axis";
HighchartsBrokenAxis(Highcharts);
Next, I want to suggest another solution - use the render
callback to check the yAxis.minData
and do an update on the yAxis.
chart: {
events: {
render() {
const chart = this,
yAxis = chart.yAxis[0],
dataMin = yAxis.dataMin;
if (chartForRender) {
chartForRender = false;
yAxis.update({
breaks: [
{
from: 1,
to: dataMin
}
]
});
}
chartForRender = true;
}
}
},
Notice that I used the chartForRender
flag to be sure that the update call will be triggered only once.
Demo: https://stackblitz.com/edit/react-jr5bjw?file=index.js
API: https://api.highcharts.com/highcharts/chart.events.render
API: https://api.highcharts.com/class-reference/Highcharts.Axis#update
Source: stackoverflow.com
Related Query
- Highcharts adding additional series and axis breaks existing yAxis min/max
- Strange character in the Highstock source code
- Highcharts, x Axis Label / Ticks after Breaks
- Including source for Alchemy js breaks Highcharts js
- upgrade to highstock 1.3.1 breaks resize code
- Calculate Y-axis breaks
- In the following code i want to show the WHOLE names on x axis nd dont want them to overlap with the legend
- Highcharts breaks on axis
- Hide axis and gridlines Highcharts
- how to hide highchart x - axis data values
- Highcharts: Set y Axis Max and Min dynamically, and not at creation
- Change HighCharts axis title
- how to set the interval of points on Y - Axis highcharts
- How replicate the value of Y Axis on both sides of the axis in Highcharts
- How can I get the max value of a y axis at highcharts?
- Highcharts Area graph, use 2 fill colors above / below X axis
- Highcharts: min value of y axis on the bottom of chart
- Drawing horizontal lines parallel to x axis using highcharts.js
- Highcharts y axis thousands separator
- Javascript Highcharts v3.0.5 - How to hide Y Axis Title when using multiple Y Axis
- Highcharts - set maximum range for yAxis but keep axis dynamic within that range
- How can I change the unit at y axis dynamically at Highcharts?
- How do I set a minimum upper bound for an axis in Highcharts?
- Highcharts how to change x axis options
- Optimize JavaScript DrillDown code
- Highcharts - How to start x axis from an arbitrary value
- How to show all values at datetime axis in highcharts?
- How to display highchart y axis with constistant data
- Highcharts - best way to handle and display zero (or negative) values in a line chart series with logarithmic Y axis
- Highcharts - Long multi-line y axis labels causing following label to be removed
More Query from same tag
- Hover entire container contents with an Overlay
- Unable to apply custom pipe to high chart tooltip values
- Pie Chart connected to a mysql database (Using Highcharts)
- Highcharts Highstock align x-axis gridlines with center of data point
- How to deal in Highcharts with special characters from CSV file?
- Highcharts Maps - Displaying data on Highmaps
- Multiple click events on multiple axes chart?
- 24-Hour Time Event Chart using HighCharts
- Color individual markers on hover in Highcharts
- How to show the container in a nested treemap?
- Highcharts dual yaxis scaling issue
- How to add lines between individual data points?
- Highchart value series mapping
- highcharts values from database in asp.net c#
- using Highstock and Highchart-Gantt on same page
- Highcharts: Y axis label formatter
- how to draw a directed path on a map in highcharts?
- Where to set displayed data vs plotted data in Highcharts?
- how to show data json to 2 different highchart bar
- Highcharts tooltip formatter
- How do I add a real gap in high stocks so it would be visible on the chart?
- High charts AddAnnotation is not a function for dynamic adding
- JavaFX StackedBarChart automatically reuse the same color on different series: how to avoid it?
- Labels on the Y axis and grids
- Getting numbers on Y-axis to show up as percentages with code from a Highcharts code generator tool?
- Setting formatter callback using highcharts-convert.js
- Highchart network graph with tooltip when hover on every node
- Controlling the the spacing between the series to avoid cluttering in Highcharts
- Donut Chart : Trigger legend or pie click event while selecting outside filter state change
- Highcharts - Area Chart - Stacking with series containing negative and positive values