Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I make this code work #26

Open
luisfeijoo opened this issue Jul 16, 2017 · 0 comments
Open

How do I make this code work #26

luisfeijoo opened this issue Jul 16, 2017 · 0 comments

Comments

@luisfeijoo
Copy link

luisfeijoo commented Jul 16, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant