I am using twitter bootstrap with tabs. I have multiple tabs and charts inside each tab. Upon browser resize, charts that are not on the current active tab do not get resized. Infact, it looks kind of funny with a thin bar. The current active tab works fine. Has anyone seen this issue and are there any workarounds ?
标签:
highcharts
相关问题
- Issues using highcharts node export server from Cl
- Rails collecting and rendering JSON data in to a H
- Create highchart density with more than 2 groups
- Highcharts / Highstock step line without vertical
- Highcharts Synchronized charts display tooltip
相关文章
- Change color of bars depending on value in Highcha
- Changing Highcharts data series type dynamically
- Set highcharts y-axis min value to 0, unless there
- high chart sample
- Highchart's gauge with gradient plotband
- HighCharts pie chart X-axies values are not displa
- Why Highcharts gets different size on Safari?
- Ajax JSON in to Highcharts Pie Chart
Here is a working example:
http://codepen.io/colinsteinmann/pen/BlGfE
Basically the .reflow() function is called on each chart when a tab is clicked. That way the chart gets redrawn based on the new dimensions which are applied to the container when it becomes visible.
This is the most important snippet of code:
add
class="chart"
to all highcharts containers inside tabs.add this jQuery code:
So this is a bit old, but for anyone stumbling across this, I was having a similar issue with the highchart sizes being incorrect in a bootstrap tabbed display. The solution I came up with was to just delay creating the chart by 100ms using setTimeout().
Note: drawBarChart is a custom function I created to generate the charts I needed. The issue (at least in my case) seemed to be that the chart was being created before (or at the same time) as the container and was therefore choosing some default width instead of the width of the container.
i fix this problem with the next code.
in my case is a partial "_partialDetalleProyecto"
I hope works you.
I found the answer after looking for sometime. This was driving me crazy so I want to share it with you all since nothing here worked for me.
Add this to your CSS
For more details visit the page I found the solution at https://jonpolygon.com/bootstrap-tabs-100-percent-width-charts/
I had a similar issue and I found that the best thing was not to load the chart until the tab was shown. So in the tab shown event I was quickly loading the chart (but only once)