score:3
I think this is duplicate of this one or this one question. Or at least the answer is very similar.
In short: when chart is rendered, width and height for the container are undefined
or 0
(container is not part of the DOM or is hidden by display: none
), which results in default width and height for the chart.
Workaround is to give browser (and angular) a breath and in setTimeout
(or $timeout
) call chart.reflow()
to allow the chart to adapt to the container, see: http://jsfiddle.net/xxy2uy9x/5/
$scope.chartConfig = {
options: {
chart: {
type: 'bar',
events: {
load: function() {
var c = this;
setTimeout(function() {
c.reflow();
}, 123)
}
}
}
},
series: [{
data: [10, 15]
}],
title: {
text: 'Hello'
},
loading: false
};
Source: stackoverflow.com
Related Query
- Integrating Highcharts into Angular-gridster
- Angular 11 - How to import array data into highcharts
- Integrating Highcharts into an Ember Application
- Integrating Highcharts into Weebly
- Rendering Highcharts using Angular js Directives
- How to use highcharts with angular 5?
- Getting error while using highcharts in Angular 7
- Load data into Highcharts with Ajax
- Rails - convert date string into javascript date object for highcharts
- Angular HighCharts ParlimentChart is not working
- How to get multiple data series into Highcharts
- Converting svg from Highcharts data into data points
- How to pass custom data into Highcharts graph click event
- Turn long list of items in Highcharts legend into dropdown
- How to fix "Property 'type' is missing in type but required in type 'SeriesXrangeOptions'" in angular highcharts module
- Highcharts instance created in which Angular life cycle hook
- how to parse json into highcharts
- Highcharts Angular with API data
- Highcharts spans beyond bootstrap column width when implemented as an angular directive
- How to structure Angular with Highcharts and lots of dynamic data
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- How do I use an Highcharts Solid Gauge in angular 6 with typescript?
- Angular Highcharts - How to enable noData options and update it dynamically
- Angular JS - "Error: [$interpolate:interr] Can't interpolate:" when using Highcharts
- Integrating Ember bindings with highcharts
- Highcharts - Global configuration with common code and unique data & Headings
- How to enable noData with highcharts and angular
- Get x-axis label into the first colomn of the table - highcharts
- Explanation of why I need to wrap a highcharts jquery event in an angular $timeout to access properties
- Add custom buttons in Angular Highcharts Line Chart
More Query from same tag
- Highcharts - How to make a scatter plot with multiple series from HTML table
- How does it implement this chart with highcharts?
- Do I need to install anything to run Highchart?
- highcharts - Adding a seperate lines between the lines in categories
- how to display drilldown column highchart using json array objects - 3 level drilldown column highchart
- Multiple tooltip with numericsymbols (date turns timestamp) in R
- Highlight a Table Row when Mouseover HighChart Pie
- Javascript - Page slow to show after not being the active tab
- using library highcharts with asp.net mvc 3
- Form data series for highcharts columns
- Rails, Highchart maps - adding custom data
- Highcharts Add text to label
- Rxjs How to wait for all observables from dynamic components to complete in smart component
- highchart : Add the series name on the column chart
- Capturing touch events (touchstart and touchmove) in addition to mousemove for synchronising highcharts
- highcharts error #13 histogram
- HTML displaying values in JavaScript "data"
- How to overcome missing values in Highstock-Stockchart?
- How to get multiple series data in tooltip highcharts (Without loosing tooltip pointer arrow)
- Can I hide legend name in StackedChart using HighChart?
- Highchart renders differently for height on first click
- Highcharts export only renders one quarter of the image
- Missing bar in barchart when using highstock.js instead of highcharts.js
- Is HighCharts supported in IE9?
- Highchart treemap color averages out
- Highcharts: wrap column chart month ranges in year
- Populating data to Highstock
- Color contrast setting on dataLabels style parameter using Highcharts 5 is not working on some colors
- missing the last element of the line
- PhantomJS with embedded web server uses only one CPU