当前位置:网站首页>UE4 WebBrowser chart cannot display problems

UE4 WebBrowser chart cannot display problems

2022-06-25 00:08:00 foenix66

UE4 WebBrowser Charts cannot show problems

Strange question

UE4 Built in WebBrowser Show web page , Other parts are normal , Only the chart on the page (echarts) Unable to display .
 Insert picture description here Various browser tests are normal , take UE4 The output to the mobile terminal is also displayed normally , only PC Can't show .

It is normal for the test to load other people's chart pages , Can be determined webbrowser Is able to support web charts . After a series of twists and turns , Upgrade web plugin , Finally write the simplest chart page , Finally, it is normal
 Insert picture description here

Final test

Through the following code

    $(document).ready(function () {
    
        alert(window.innerWidth + "*" + window.innerHeight);
    });

It turns out that the problem is PC Of WebBrowser Plug in on Web page ondocumentready when , The page size is 0x0. If echarts Of dom object css Yes press fixed px Size setting , It can be displayed normally , Follow the page % Set up , It won't show ( because ondocumentready The page size is 0x0)
 Insert picture description here

terms of settlement

Add the following... To the web page javascript Script

window.addEventListener('resize', myChart.resize);

WebBrowser After loading, the page size will be reset according to the layout size , After setting to normal browser size , Reset chart The size of the
 Insert picture description here

原网站

版权声明
本文为[foenix66]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206241907530519.html