# TreeMap

```javascript
var functionString = "function(ctx) {";
functionString += "const color = 'rgba(1, 25, 255, 0.1)';";
functionString += "if (ctx.dataset.data[ctx.dataIndex]) {"
functionString += "return color.split('.1').join('.' + ctx.dataset.data[ctx.dataIndex].v);"
functionString += "}";
functionString += "}";
	
var data = {
	type: 'treemap',
	data: {			
		datasets: [{
            label: 'Basic treemap',
            tree: [6,6,5,4,3,2,2,1],
            fontColor: '#000',
            fontFamily: 'serif',
            fontSize: 12,
            fontStyle: 'normal',
            backgroundColor: clientutils.generateBrowserFunction(functionString)
		}]
	}
}
	
//Initialize the chart by using setData
elements.chart.setData(data);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.servoy.com/guides/develop/application-design/ui-components/visualization/svychartjs/treemap.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
