There is not an automatic way to center the labels like that. There is an open issue/feature request here: https://github.com/google/google-visualization-issues/issues/2352
I've previously used the answer in this Stack Overflow post <https://stackoverflow.com/questions/43845104/moving-google-chart-column-annotation-position> to center labels using a MutationObserver. On Tuesday, September 10, 2019 at 8:28:53 AM UTC-6, gottfried_s wrote: > > This is my code: > > > google.charts.load('current', {packages: ['corechart', 'bar']}); > google.charts.setOnLoadCallback(drawChartp); > function drawChartp() { > var data = google.visualization.arrayToDataTable([ > [' ', 'CDU', 'SPD', 'GrĂ¼ne', 'UWG', 'FDP'], > ['', 1200, 900, 50, 30, 20], > ]); > > var options_fullStacked = { > title: 'Stimmenanteil (%)', > isStacked: 'percent', > backgroundColor: 'transparent', > fontSize: 18, > colors: ['black', '#e2021b', '#1fa12d', '#2382c0','#ffec01'], > height: 150, > width: 800, > legend: {position: 'none', maxLines: 3}, > hAxis: { > minValue: 0, > ticks: [0, .25, .5, .75, 1] > } > }; > > var formatter = new google.visualization.NumberFormat({decimalSymbol: ',', > fractionDigits: 0, groupingSymbol: '.'}); > formatter.format(data, 1); > > var chart = new > google.visualization.BarChart(document.getElementById('piechart')); > chart.draw(data, options_fullStacked);} > > I am a novice with Google chart. How can I acchieve to get the value in > the center of the stacked item? This is want I would like to see: > > [image: wanted.png] > > > Who can help me? > > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/e78814dd-273b-464a-8891-8ad17fe1f994%40googlegroups.com.
