答案 0 :(得分:1)
使用选项-> baselineColor
在一个或两个上-> hAxis
,vAxis
var options = {
hAxis: {
baselineColor: 'magenta',
},
vAxis: {
baselineColor: 'magenta',
}
};
请参阅以下工作片段...
google.charts.load('current', {
packages: ['corechart']
}).then(function () {
var data = google.visualization.arrayToDataTable([
['x', 'y'],
[0, 1],
[1, 2],
[2, 3],
]);
var options = {
hAxis: {
baselineColor: 'magenta',
},
vAxis: {
baselineColor: 'magenta',
}
};
var chart = new google.visualization.LineChart(
document.getElementById('chart_div')
);
chart.draw(data, options);
});
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>