1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# Borrar gráfico anterior rm .\grafico.html $valor2= 20 $inicio="<head> <script src=""https://www.gstatic.com/charts/loader.js""></script> <script> google.charts.load('current', {packages: ['corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart() { // Define the chart to be drawn. var data = new google.visualization.DataTable(); data.addColumn('string', 'Element'); data.addColumn('number', 'Percentage'); data.addRows([ ['Bob Esponja', "+$valor2+"], ['Bob Esponja 2', "+$valor2+"] ]); // Instantiate and draw the chart. var chart = new google.visualization.BarChart(document.getElementById('myPieChart')); chart.draw(data, null); } </script> </head> <body> <!-- Identify where the chart should be drawn. --> <div id=""myPieChart""/> </body>" $inicio | Out-File grafico.html -Encoding default -Append |