Remove all text from graph?

14 views
Skip to first unread message

Matthew Poletiek

unread,
Aug 15, 2017, 5:39:49 PM8/15/17
to Google Visualization API
Trying to basically create a sparkline(bar) in a dynamically created <table>. I need to remove all text from the bar chart. Here is my code.

for (i=0; i<keys.length; i++){
 dataTable
= new google.visualization.DataTable();
 dataTable
.addColumn('string', 'ID')
 dataTable
.addColumn('number', 'Dead');
 dataTable
.addColumn('number', 'Closed');
 dataTable
.addColumn('number', 'Blocked');
 dataTable
.addColumn('number','Active');
 
var id = data[keys[i]][[0]];
 
var dead = data[keys[i]][[8]];
 
var closeditem =  data[keys[i]][[7]];
 
var blocked = data[keys[i]][[9]];
 
var active = data[keys[i]][[6]];


 dataTable
.addRows([
 
[id, dead, closeditem, blocked, active]
 
]);
 
 
var options = {
 titlePosition
: 'none',
 series
: {
 
0:{
 color
: 'black'
 
},
 
1:{
 color
: 'navy'
 
},
 
2:{
 color
: 'red'
 
},
 
3:{
 color
: 'grey'
 
}
 
},
 hAxis
: { textPosition: 'none', textColor: '#ffffff', gridlines: { color: 'transparent' } },
 vAxis
: { textPosition: 'none', textColor: '#ffffff', gridlines: { color: 'transparent' } },
 axisFontSize
: 0,
 bars
: 'horizontal',
 isStacked
: true,
 legend
: {position: 'none'}
 
};
 
 
var element1 = data[keys[i]][[0]];
 
 
var chart = new google.charts.Bar(document.getElementById(element1));
 chart
.draw(dataTable,google.charts.Bar.convertOptions(options));
 
 
}

Attached is the image of the chart outputted. How do I get rid of the numbers on the hAxis and the label on the left?


Capture.PNG
Reply all
Reply to author
Forward
0 new messages