I got this chart in line chart of google api.
Here i'm trying to display the point value in above the point. so i'm using annotation. Here how to remove annotation tick mark in between the points(23 & 2008, 145 & 2009...) in google api chart.
<script type="text/javascript">
google.load("visualization", "1", {packages: ["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Year');
data.addColumn({type: 'number', role: 'annotation'});
data.addColumn('number', 'Sales');
data.addRows([
['2008', 23, 54],
['2009', 145, 55],
['2010', 245, 56],
['2011', 350, 57]
]);
var options = {
width: 400,
height: 200,
pointSize: 4,
legend: {position: 'none'},
chartArea: {
left: 0,
top: 60,
width: 400,
height: 50},
vAxis: {
baselineColor: '#fff',
gridlines: {color: 'transparent'},
maxValue:'58',
minValue:'52'
},
tooltip: {trigger: 'none'},
annotation: {
1: {
style: 'default'
}
}
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
You can remove the annotation tick marks or 'stems' by setting the stemColor
parameter to none:
annotations: {
stemColor : 'none'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With