0

Olá, Estou com um problema, não consigo alinhar a annotation dentro da coluna, sendo que a annotation deve ficar na vertical, segue código:

<div id="grafico_qtd_clientes"></div>

<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>

segue imagem do gráfico, o annotation não fica centralizado dentro da coluna como deveria por causa do 'Stem'

[1]: https://i.stack.imgur.com/HMdr7.png

1 Resposta 1

-1

Tenta colocar assim:

annotations: {
                      <% if intervalDatas > 8 Then %>
                      style: 'point',
                      <% End if %>
                      textStyle: {
                        fontSize: 12,
             },

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .