0

我需要像饼图这样的多色,如何在条形图中做到这一点?

<?php
$connect = mysqli_connect("localhost", "handsmec_sales", "handsmec_sales", "handsmec_sales_portal");  
$query2 = "SELECT DATE_FORMAT(order_datetime,'%m/%Y') as date, SUM(order_total_after_tax) as number FROM tbl_order where status='Confirmed' GROUP BY DATE_FORMAT(order_datetime,'%Y/%m')";  
$result2 = mysqli_query($connect, $query2); 
?>

<div id="Salesman" style="width: 650px; height: 500px;"></div>   
4

1 回答 1

-1

您可以将{ role: 'style' }添加到数据表中。对于您希望具有相同颜色的所有列,只需指定一个空样式 ''。然后,在您想要红色的列上,您可以指定“红色”“#ff0000”或“颜色:红色”等。这里是参考链接

// example from Google
var data = google.visualization.arrayToDataTable([
    ['Element', 'Density', { role: 'style' }],
    ['Copper', 8.94, '#b87333'],            // RGB value
    ['Silver', 10.49, 'silver'],            // English color name
    ['Gold', 19.30, 'gold'],
    ['Platinum', 21.45, 'color: #e5e4e2' ], // CSS-style declaration
]);
于 2019-05-06T07:17:04.330 回答