我创建了一个带有注释的水平折线图,但是当两点太靠近时,注释文本会相互覆盖,如何避免注释相互覆盖?这是我的示例图表:
google.charts.load('current', {packages: ['corechart', 'line']});
google.charts.setOnLoadCallback(drawLogScales);
function drawLogScales() {
var data = new google.visualization.DataTable();
data.addColumn('number', 'X');
data.addColumn('number', 'Y');
data.addColumn({type:'string', role:'annotation'});
data.addColumn({type:'string', role:'style'});
data.addRows([
[0, 0,'pneumonoultramicroscopicsilicovolcanoconiosis',''],
[0, 0,'QAQ',''],
[0.1, 0,'ABCDEFG',''],
[1, 0,'123',''],
]);
var options = {};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>
谢谢你