我需要像饼图一样的多色,如何在条形图中做到这一点?
<?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>
答案 0 :(得分:0)
您可以在数据表中添加 {角色:'style'} 。对于您想要具有相同颜色的所有列,只需指定一个空样式”。然后,在要设为红色的列上,只需指定'红色'或'#ff0000'或'颜色:红色',以此类推。此处为参考link
// 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
]);