Làm cách nào để thay đổi màu của văn bản chú thích trong Công cụ Biểu đồ của Google?Cách thay đổi màu của văn bản chú thích trong google-charts
Dưới đây là một ví dụ
google.load('visualization', '1', {packages: ['corechart']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('date', 'Date');
data.addColumn('number', 'Sales');
data.addColumn({id: 'title', label: 'Title', type: 'string', role: 'annotation'});
data.addRows([
[new Date(2012, 3, 5), 80, null],
[new Date(2012, 3, 12), 120, 'New Product'],
[new Date(2012, 3, 19), 80, null],
[new Date(2012, 3, 26), 65, null],
[new Date(2012, 4, 2), 70, null],
]);
var options = {
title: 'Sales by Week',
displayAnnotations: true,
hAxis: {title: 'Date',
titleTextStyle: {color: 'grey'}},
colors: ['#f07f09']
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
Tôi muốn các dòng là cam và các văn bản chú thích màu xám. Hiện tại, văn bản chú thích có màu cam.
Tìm câu trả lời gần đây của tôi. Có rất nhiều phiên bản của Google Charts và nó đã phát triển qua các năm –