score:0
in Polymer 3 I had to use window.setTimeout() function to get width working properly as below.load: function() { window.setTimeout(() => { this.reflow(); }, 1); },
score:1
In angular project I had to use setTimeout()
function to get width working properly as below:
setTimeout(()=>this.chart.reflow())
score:3
This was answered, but not clearly enough imo. Highcharts documentation says
... In most cases the chart is built in one thread, but in Internet Explorer version 8 or less the chart is sometimes initiated before the document is ready, and in these cases the chart object will not be finished directly after calling
new Highcharts.Chart()
. As a consequence, code that relies on the newly built Chart object should always run in the callback.
So, dealing with the chart object in IE8 must be done in the callback, i.e. new Highcharts.Chart(options, function(chart) { ... })
. You can also use function() { ... }
and use this
in the function.
In regards to your specific concern re a loading message. I had to do it in the callback, but it works.
chart1 = new Highcharts.Chart(options, function(){
this.showLoading();
});
score:8
Try with the redraw
event. This event is triggered after loading, but also after the series was added and chart resizing.
$(function () {
// create the chart
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
events: {
redraw: function(event) {
alert ('Chart loaded');
}
}
},
series: [{
animation: false,
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
});
});
Redraw event from offical Highcharts reference: http://api.highcharts.com/highcharts#chart.events.redraw
score:8
In the load callback function, you can access the chart object by using "this" pointer.
events: {
load: function(event) {
alert ('Chart loaded with series :'+ this.series[0].name);
console.log(this);
}
}
JsFiddle : http://jsfiddle.net/msjaiswal/AVygG/25/
score:24
Highcharts has callback function
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
events: {
redraw: function(event) {
alert ('Chart loaded');
}
}
},
series: [{
animation: false,
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
},function(chart){
alert('LOADED');
});
Source: stackoverflow.com
Related Query
- when is a highchart completely loaded?
- Highchart completely loaded after animation event
- Why does my Highchart look different when I transfer my code from Jsfiddle to my server?
- x-axis, y-axis lines does not appear, when I include 3D chart library of HighChart in my code
- Highchart spline Cut Off when reach to maximum scale value. How can it fixed?. I have attached may sample code on body
- Resolve Conflict When Using Highchart and Highmap together (TypeError: ma is not a function)
- Call an angular component method when we click on highchart series
- I need Highchart watermark image when i download highchart
- Code works on fiddle but not when I do /show
- Highchart not resized when hidden
- Highchart ticks start point change when categories names are set
- using angular directive to draw highchart pie chart but when i am using it in success function it is not working
- Is there a way how to dynamically create a plotline in highchart when the value is lower than previous one?
- When using canvg to convert Highchart SVG into PNG, all text appears twice - how to solve?
- Highchart does not load data from hidden input when using .val
- Highchart is not resizing dynamically when used as a angular directive
- Highchart pie - datalabel cannot be selected when setting useHTML=true
- highchart stock : graph disappear when containing weekend data point
- Why is the legend of my HighChart PieChart behaving irradically, when I update my series data?
- How do I set the highchart gantt headers as fixed when I scroll vertically
- pie chart legend overlap with older legend when replace series in highchart
- Hide Scrollbar when Printing highchart from export menu
- Hide a category when a series name has no value attributed to it highchart
- Highchart not displaying when used with drop down
- Why is Highchart loaded twice in my rails app ? (Uncaught Highcharts error #16)
- Highchart loses fillOpacity when fillColor is specified
- How can I get inner slice when clicking on an outer slice in a HighChart donut chart?
- How to fade other yAxises in highchart when hover on marker?
- Highchart Drilldown with data call when clicked
- Highchart update tooltip when setData
More Query from same tag
- Highchart Json Format for Highchart stock chart
- Content must fill available space down to footer and highchart must be reponsive (no scrolling allowed)
- Highcharts in arearange, how to disable this tooltip?
- highcharts polar chart, move labels individually to fit small space
- Custom HTML marker in Highmaps
- plot area width and height in HighCharts
- Removing event Listeners in react using highcharts
- Manual series names in highcharter
- I'm trying to create a timeseries chart having stacked columns in HighCharts
- Highcharts Gauge Spacing
- Highcharts Stacklabel Style backgroundColor
- In the following code i want to show the WHOLE names on x axis nd dont want them to overlap with the legend
- Custom tooltip data for specific points on highchart
- Is it better to update a Highcharts chart or destroy and recreate it?
- Change a highchart x axis Label
- how to draw hour and minute value (hh:mm) pie chart using highcharts,javascript
- Is there a way to have a toggled legend item save its state on refresh?
- Create a heatmap using Yii2 highcharts widget
- Changing X axis type from category to datetime on drilldown
- How can I show last 10 indexes in Highcharts Timeline and left using scroll?
- Unable to load the series without duplication on highchart using angular 4
- Fullscreen panel bootstrap with highcharts (100% height)
- highcharts missing x axis labels when stacking two charts
- How use joinBy with subregion in France with HighMaps?
- Unable to set a format for values on a heatmap
- How do i add mouse wheel code in Angular2 highcharts in typescript
- Highcharts - How to set custom colors for the series
- How to aligment nodes with highcharts
- HighCharts Drill down not working
- Getting Data from PHP, JSON Highcharts?