jQuery UI Tabs and Highcharts display/rendering issue

前端 未结 13 2334
长发绾君心
长发绾君心 2020-12-28 18:57

Anyone ever used the tabs (jquery-ui-1.8.9) and pie charts from Highcharts 2.1.4 together? To put it simply, I have multiple tabs, where each tab s

相关标签:
13条回答
  • 2020-12-28 19:33

    This worked for me after adding the class name (contains-chart) in the tabs

    jQuery(document).on('shown.bs.tab', 'a[data-toggle="tab"]', function (e) { // on tab selection event
                jQuery(".contains-chart").each(function () { // target each element with the .contains-chart class
                    var chart = jQuery(this).highcharts(); // target the chart itself
                    chart.reflow() // reflow that chart
                }
    
    0 讨论(0)
提交回复
热议问题