SetupTreemap() {
this.googleChartLibrary = (<any>window).google;
this.googleChartLibrary.charts.load('current', {'packages':['treemap']});
this.googleChartLibrary.charts.setOnLoadCallback(this.DrawTreemap.bind(this));
}
DrawTreemap () {
let treemapData = this.googleChartLibrary.visualization.arrayToDataTable([
['Title', 'Parent', 'Size', 'Color'],
['Global',null,0,0],
['Header 1' + '(This should be on line 2)','Global',144179.10,0],
['Header 2','Global',58095.20,25],
['Header 3','Global',143034.89,50],
['Header 4','Global',36163.36,75],
['Header 5','Global',28000,100],
]);
let tree = new this.googleChartLibrary.visualization.TreeMap(document.getElementById('treemap-div'));
this.googleChartLibrary.visualization.events.addListener(tree, 'select', function () {
tree.setSelection([]);
});
tree.draw(treemapData, {
minColor: this._chartColor1,
midColor: this._chartColor2,
maxColor: this._chartColor3,
textStyle: {
color: '#ffffff',
fontSize: 16,
bold: true,
italic:false
},
showScale: false,
showTooltips: false,
maxDepth: 1,
height: 350,
headerHeight: 0,
highlightOnMouseOver: false,
useWeightedAverageForAggregation: true
});
}