Org Chart issue: Displaying two values without breaking ID - parent relation

13 views
Skip to first unread message

Johannes Keim

unread,
Nov 17, 2015, 10:00:39 AM11/17/15
to Google Visualization API
Hello, 

my goal is to display a recruiting process (name of step, e.g. CV check and the amount of applications in this step, e.g. 50) as an Org chart. To complicate matters, the data is being loaded from my postgresql database. Everything works fine except that I am only able to display the name of the steps but not the values. Once I concencate the strings the relations are obviously broken. Currently, the values I want to see added to the label are displayed as a tooltip. Current output: 





 nodeTodo
.controller('pieController', ['$scope', '$http', function($scope, $http){
   
   
// get data from postgresql
    $http
.get('/api/v1/stats')
   
.success(function(data){
       
var pieData =[];


       
var chartData = new google.visualization.DataTable();
        chartData
.addColumn('string', 'Status');
        chartData
.addColumn('string', 'Summe');
        chartData
.addColumn('string', 'Test');
       
for(var i=0;i<data.length; i++){
//this is where I push the values into the array. I want to show the values for "rest" alongside the values for "phase"
            pieData
.push([data[i].phase, data[i].relation, data[i].rest]);
            chartData
.addRow(pieData[i]);
       
}
       
var chart = new google.visualization.OrgChart(document.getElementById('piediv'));
       
var options =
           
{
            is3D
: true,
            legend
: 'none'
           
};  
        chart
.draw(chartData, options, {allowHtml:true});
       
})
       
.error(function(error) {
            console
.log('Error: ' + error);    
   
})
}]);


Any help would be highly appreciated. 
        
Reply all
Reply to author
Forward
0 new messages