import { AgChartOptions } from '@ag-grid-community/core' ; import * as agCharts from 'ag-charts-community' ; declare var data ; const options = { type : 'hierarchy' , container : document . getElementById ( 'myChart' ) , data , series : [ { type : 'treemap' , labelKey : 'name' , sizeKey : 'size' , colorKey : 'color' , tooltip : { renderer : params => { return { content : `<b>Change</b>: ${ params . datum . colorValue . toFixed ( 2 ) }%` , } ; } , } , } , ] , title : { text : 'S&P 500 index stocks categorized by sectors and industries.' , } , subtitle : { text : 'Area represents market cap. Color represents change from the day before.' , } , } ; agCharts . AgChart . create ( options ) ;