2016-06-21 10 views
0

Ich habe eine eckige App und ich verwende Google-Charts (https://github.com/angular-google-chart/angular-google-chart), um einige Daten mit Hilfe von Diagramm zu zeigen.Angeben der maximalen Wert für Google Diagramm Achse in angularjs

Derzeit mein Diagramm sieht wie folgt aus:

enter image description here

Die horizontale Achse die Anzahl der Benutzer meiner Anwendung, die ich von meinem Backend bin holen. Ab sofort ist dies irgendwie auf 4 beschränkt, ich kann nirgends den Code finden wo es spezifiziert ist. Gibt es eine Möglichkeit, die Grenze der horizontalen Achse auf die Gesamtzahl der Benutzer festzulegen?

Mein Code sieht wie folgt aus:

//Populate chart values 
       $scope.myChartObject.data = {"cols": [ 
        {id: "t", label: "Parameter", type: "string"}, 
        {id: "s", label: "Number of users", type: "number"} 
        ], "rows": [ 
       {c: [ 
       {v: "Today's total logins"}, 
       {v: $scope.today_login_count}, 
       ]}, 

       {c: [ 
       {v: "Last week's total logins"}, 
       {v: $scope.week_login_count} 
       ]}, 

       {c: [ 
       {v: "Last month's total logins"}, 
       {v: $scope.month_login_count}, 
       ]}, 

       {c: [ 
       {v: "Users who completed our trainign plan"}, 
       {v: 0}, 
       ]} 
      ]}; 


      $scope.myChartObject.options = { 
       'title': 'App usage analytics at a glance' 
      }; 

Antwort

0
$scope.myChartObject.options = { 
       'title': 'App usage analytics at a glance', 
       'hAxis': { 
       title: 'Total users', 
       minValue: 10 
       }, 
      }; 

das Problem gelöst!