vue-charts icon indicating copy to clipboard operation
vue-charts copied to clipboard

How do I make this code work

Open luisfeijoo opened this issue 7 years ago • 0 comments

<html>
  <head>
    <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 = new google.visualization.DataTable();
      data.addColumn('string', 'Name');
      data.addColumn('number', 'Recuento');
      data.addColumn({type: 'string', role: 'annotation'}, '');

      data.addRows([
        ['1', 2, '(0) 0%'],
        ['2', 2, '(34) 71%'],
        ['3', 1, '(0) 0%'],
        ['4', 3, '(0) 0%'],
        ['5', 1, '(0) 0%']
      ]);

      var view = new google.visualization.DataView(data);
      view.setColumns([0, 1, 1, 2]);

      var chart = new google.visualization.BarChart(document.getElementById('chart_div'));

      chart.draw(view, {
        title: 'home',
        legend: 'none',
        height: 400,
        width: 800,
        series: {
          0: {
            type: 'bars',
            color: "rgb(103, 58, 183)"
          },
          1: {
            type: 'line',
            color: 'black',
            lineWidth: 0,
            pointSize: 0,
            visibleInLegend: false
          }
        },
        vAxis: {
          format: '#',
          viewWindowMode:'explicit',
          viewWindow: {
              min:0
        }
    }
      });
    }
    </script>
  </head>
  <body>
    <div id="chart_div"></div>
  </body>
</html>

captura

Does not work with <vue-chart></vue-chart>

luisfeijoo avatar Jul 16 '17 05:07 luisfeijoo