Problem with WebHTMLViewer and google charts

Hi everyone!
Are there any new limitations in the WebHTMLViewer control in 2.0 compared to web 1.0?
Previously, I used to reproduce Google Charts without problem and currently nothing appears.
For example (previously tested):

<html>
  <head>
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">
      google.charts.load('current', {'packages':['bar']});
      google.charts.setOnLoadCallback(drawChart);

      function drawChart() {
        var data = google.visualization.arrayToDataTable([
['Mes', 'Empresas', 'Club Cámara'],['Ene', 13 , 3],
['Feb', 21 , 6],
['Mar', 35 , 12],
['Abr', 48 , 5],
['May', 18 , 14],
['Jun', 27 , 7],
['Jul', 23 , 12],
['Ago', 5 , 1],
['Sep', 0 , 0],
['Oct', 0 , 0],
['Nov', 0 , 0],
['Dic', 0 , 0],

        ]);

        var options = {
          chart: {
            title: '',
            subtitle: '',
            legend: { position: "none" },
          }
        };

        var chart = new google.charts.Bar(document.getElementById('columnchart_material'));

        chart.draw(data, google.charts.Bar.convertOptions(options));
      }
    </script>
  </head>
  <body>
    <div id="columnchart_material" style="width: 100%; height: 100%;"></div>
  </body>
</html>

In web 1.0:

Thanks!

Hello @Roberto_Alvarez1 have you solved the google charts that were previously on web 1 with web 2? I guess it’s an WebHTMLViewer issue.

I don’t see this reported on Issue so I created a case:
#72473 - WebHTMLViewer no longer works with Google Charts (Web1 works)

It looks like is different how Web1 vs Web2 handles the WebHTMLViewer, I’m not sure if will be possible to make it work again without WebSDK.

3 Likes

I added a working example to the case that uses WebFile to load the HTML by URL. I think this is the intended behavior with Web2. Unless using a URL, the content is inline on the page. When using a URL an iframe is the parent of the content (which it needs to be in this case). Though this isn’t documented, I remember there being a discussion about it at some point.

3 Likes

Estimados, la aplicación que usa el webfile como indica @Anthony_G_Cyphers me funciona localmente, PERO cuando la subo a Linux no me muestra nada, tendra algo que ver con ese archivo que se está generando?

It should just work. It’s not doing anything fancy. Check the browser’s console for error messages.

@Anthony_G_Cyphers aplique ambos casos, localmente no me da problema, al subirlo al server linux no me muestra nada.

En base a eso hice 2 gráficas, la primera usa el SDK y la segunda el webfile.

Localmente:

Ya alojada en server (linux):

Es extraño porque quizás no sea el tema del webfile ya que una de ellas es con SDK y funcionan ambas bien localmente.
Puede ser que alguna restricción del servidor me bloquee ésta característica? Es decir quizás al hacer la petición externa el server esté bloqueando algo, puedo consultar al proveedor (igual no he tenido problemas con otros casos).
*no se como ver los errores de consola del navegador (estoy usando Chrome para Mac)