annotation vertical Google Charts

851 views
Skip to first unread message

Ezequiel Oliveira

unread,
Sep 12, 2019, 4:39:45 PM9/12/19
to Google Visualization API
Não consigo colocar as annotation na vertical dentro da column e centralizada:

google_chart.png


*Já tentei de várias formas mas sem sucesso, tenho uma pergunta no stackoverflow em aberto, segue link:


Segue código utilizado para gerar este gráfico acima com o Google Chart:


<div id="grafico_qtd_clientes"></div>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" google.charts.load("current", {packages:['corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Data', {label: 'Quantidade de Clientes', type: 'number'} ], ['01/02', 10 ], ['02/02', 10 ], ['03/02', 10 ], ]); var formatter = new google.visualization.NumberFormat({ pattern: ' ' }); formatter.format(data, 1); var view = new google.visualization.DataView(data); view.setColumns([0, 1, { calc: "stringify", sourceColumn: 1, type: "string", role: "annotation" } ]); var options = { height: 400, chartArea: { 'width': '95%', 'height': '75%', 'top': '10%' }, bar: { groupWidth: '75%' }, legend: {position: 'top'}, annotations: { <% if intervalDatas > 8 Then %> style: 'line', <% End if %> textStyle: { fontSize: 12, }, stem:{ color: 'transparent', } }, tooltip: { ignoreBounds: 'true', isHtml: true }, hAxis: { slantedText: true, slantedTextAngle: 45, textStyle: { fontSize: 12, }, }, vAxis: { textPosition: 'none', gridlines: { color: 'transparent' } }, series: { 0: { targetAxisIndex: 0, color: '#1976D2' }, } }; var chart = new google.visualization.ColumnChart(document.getElementById("grafico_qtd_clientes")); chart.draw(view, options); } </script>

Se alguém puder me ajudar, desde já fico muito agradecido a todos!
Reply all
Reply to author
Forward
0 new messages