Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove annotation tick mark in line chart of google api chart?

I got this chart in line chart of google api.

enter image description here

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>
like image 404
Arunprasath Avatar asked Nov 26 '13 09:11

Arunprasath


1 Answers

You can remove the annotation tick marks or 'stems' by setting the stemColor parameter to none:

annotations: {
   stemColor : 'none'
}
like image 113
badhaircut Avatar answered Oct 16 '22 02:10

badhaircut