score:5
According to the Highcharts api, automatic reflow only occurs on window.resize
events. You'll have to do this explicitly. I'd simply do it in gridster's resize.stop
callback:
gridster = $(".gridster ul").gridster({
widget_base_dimensions: [100, 55],
widget_margins: [5, 5],
helper: 'clone',
resize: {
enabled: true,
stop: function(e, ui, $widget) {
Highcharts.charts[0].reflow(); // reflow the first chart...
}
}
}).data('gridster');
Example fiddle here.
score:1
In my case chart.reflow()
wasn't good.
You can use chart.setSize(width, height)
I have event on resize.stop
callback and listener in function responsible for drawing charts which contains:
var height = $('#HighartsContainer').closest("li").height() - 50; //50: margin, padding, etc
var width = $('#HighartsContainer').closest("li").width() - 10;
you can also set new height or weight of container:
$('#HighartsContainer').css('height', height);
self.chart.setSize(width, height, false);
score:2
you can use resize callback
$(document).ready(function () {
gridster = $(".gridster ul").gridster({
widget_base_dimensions: ['auto', 140],
autogenerate_stylesheet: true,
min_cols: 1,
max_cols: 6,
widget_margins: [5, 5],
resize: {
enabled: true,
resize: function (e, ui, $widget) {
Highcharts.charts[0].reflow(); // reflow the first chart...
},
stop: function(e, ui, $widget) {
Highcharts.charts[0].reflow(); // reflow the first chart...
}
}
}).data('gridster');
$('.gridster ul').css({'padding': '0'});
});
Source: stackoverflow.com
Related Query
- Resize issue while gridster.js with highcharts
- resizing and positioning issue with gridster and multiple highcharts
- Highcharts cloud issue with data source when duplicating chart
- Resize height with Highcharts
- Styling bar colors in Highcharts with a gradient issue
- Resize data points with highcharts
- Highcharts data series issue with ajax/json and PHP
- Highcharts - Issue with negative values when displaying multiple axes
- Resize a chart before printing with Highcharts
- Highcharts - Global configuration with common code and unique data & Headings
- Highcharts SolidGauge Label Resize Issue
- HighCharts query parameters issue with Flask webservice
- Highcharts column + line combination chart with multiple series. Issue aligning line over the column
- How to scale Highcharts height on window resize with React
- Gauge highcharts is not resize with ionic 2
- Highcharts reloading issue with Backbone.js
- Highcharts zIndex issue with crosshair
- highcharts 5.0.14 issue with textOverflow
- Performance issue with Firefox on Highcharts and Highstocks
- passing formatting JavaScript code to HighCharts with JSON
- JSON Data Map Issue with HighCharts + Ajax
- Have an issue with JavaScript, AJAX code displaying data
- Issue with last column width in Highcharts
- Highcharts multiple x axis and yaxis. The width of the 1st x-axis is not in sync with browser resize
- Issue with Dates - trying to plot MongoDB data in Highcharts via PHP
- Highcharts - Issue with the chart reflow function
- Changing the name for 'categories' of x axis while implementing crossfilter with highcharts
- Highcharts multiple series combined with linkedTo hover issue
- MS Surface tablet IE10 with Highcharts scroll page issue
- Highcharts complex tooltip formatting issue with embedded html link
More Query from same tag
- convert mysql resultset into a (name, data) object to be fed into HighCharts
- Export Highcharts bubble lat/lon map trough their server
- How to show categorized Highcharts Chart using csv file
- use highchart and highstock on the same page
- How to add lines between individual data points?
- Data and tooltip not working for graph using highcharts
- Dynamic Highstock chart when no data at start
- Live chart in Highcharts makes the line series very .. mountainous
- Highcharts: Legend not show
- Declaring minimal width of serie in treemap
- How to add tooltip on the render image in highcharts?
- Highcharts gantt chart task progress indicator data labels for multi-color in a single task progress
- problems charts jquery highcharts
- Tooltip does not work with Gauge chart
- How can I convert datetime stamp in jQuery of a Highchart to get the correct format in json?
- highcharts splines chart - large data should plot specific data only
- Give different color to each stack in stacked bar in Highcharts
- Bootstrap - Highcharts not showing
- Highcharts: Negative values of the secondary axis should come below the x axis
- highcharter convert value to percent in tooltip
- How to customize a legend in highcharts as the image and while clicking on the leg end appears lines inside linechart
- Highchart x-axis show label after specific days no matter what is in the x-axis categories
- Is there any replacement of "zones" in highcharts?
- Highcharts CSV export changes the chart JS object
- How can I embed the AJAX output of JS in Javascript function
- Highcharts Progress Bar Chart
- Highcharts renderer: fill colour of embedded SVG image
- Highchart -change posistion of yaxis title
- Centered axes in highcharts
- print a value on highcharts bar graph?