• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

362
Views
Quiero usar este gráfico circular, pero ¿cómo cambio el color de fondo de blanco a gris?

Quiero usar este gráfico circular, pero cómo cambio el color de fondo de blanco a gris (rgb (226, 226, 226)). ¿Es posible? El gráfico circular es de https://www.w3schools.com/howto/tryit.asp?filename=tryhow_google_pie_chart .

 <html lang="en-US"> <body> <h1>My Pie Chart</h1> <div id="piechart"></div> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> // Load google charts google.charts.load('current', {'packages':['corechart']}); google.charts.setOnLoadCallback(drawChart); // Draw the chart and set the chart values function drawChart() { var data = google.visualization.arrayToDataTable([ ['Task', 'Hours per Day'], ['Work', 8], ['Eat', 2], ['TV', 4], ['Gym', 2], ['Sleep', 8] ]); // Optional; add a title and set the width and height of the chart var options = {'title':'My Average Day', 'width':550, 'height':400}; // Display the chart inside the <div> element with id="piechart" var chart = new google.visualization.PieChart(document.getElementById('piechart')); chart.draw(data, options); } </script> </body> </html>
almost 3 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Acabo de agregar el color de fondo a la opción de dibujar backgroundColor: { fill: "#e2e2e2" }

 // Load google charts google.charts.load('current', {'packages':['corechart']}); google.charts.setOnLoadCallback(drawChart); // Draw the chart and set the chart values function drawChart() { var data = google.visualization.arrayToDataTable([ ['Task', 'Hours per Day'], ['Work', 8], ['Eat', 2], ['TV', 4], ['Gym', 2], ['Sleep', 8] ]); // Optional; add a title and set the width and height of the chart var options = { 'title':'My Average Day', 'width':550, 'height':400, backgroundColor: { fill: "#e2e2e2" } }; // Display the chart inside the <div> element with id="piechart" var chart = new google.visualization.PieChart(document.getElementById('piechart')); chart.draw(data, options); }
 <html> <body> <h1>My Pie Chart</h1> <div id="piechart"></div> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> </body> </html>

almost 3 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error