Como criar um gráfico de mapa de árvore com o editor de configuração de gráficos
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Um mapa de árvore mostra dados categóricos e hierárquicos como um conjunto de retângulos, em que o tamanho de cada retângulo é determinado por uma medida numérica.
Com o Editor de configuração de gráficos, é possível criar mapas de árvore a partir de um gráfico de colunas no Looker. Para ter os melhores resultados, use uma dimensão pivotada, uma dimensão não pivotada e uma medida para criar um mapa de árvore.
Por exemplo, é possível criar um gráfico de árvore que mostra a contagem de itens do pedido em vários valores diferentes de categoria, com pivote por coleção sazonal. Cada temporada é representada por um retângulo codificado por cores, que contém retângulos menores que representam a categoria. O tamanho de cada retângulo corresponde à contagem de itens do pedido .
Para criar um mapa de árvore, comece com o seguinte snippet JSON:
{chart:{type:'treemap',}}
Como criar um gráfico de árvore
Para criar um mapa de árvore, siga estas etapas:
Confira um gráfico de colunas em uma Análise ou edite um gráfico de colunas em um Look ou painel.
Para este exemplo, recomendamos começar com um gráfico de colunas com duas dimensões e uma medida. Uma dimensão precisa ser girada. Os valores pivotados definem as categorias de nível superior usadas para renderizar o mapa de árvore. O gráfico inicial pode ser parecido com este exemplo:
Abra o menu Editar na visualização.
Na guia Gráfico, clique no botão Editar configuração do gráfico. O Looker mostra a caixa de diálogo Edit Chart Config.
Selecione a seção Configuração do gráfico (substituir) e insira o JSON do HighCharts na seção Como escrever o snippet JSON desta página.
Para que o Looker formate seu JSON corretamente, clique em <> (Format code).
Para testar as mudanças, clique em Visualizar.
Para aplicar as mudanças, clique em Aplicar. A visualização será mostrada usando os valores JSON personalizados.
Depois de personalizar a visualização, você pode salvá-la.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-25 UTC."],[],[],null,["# Creating a treemap chart with the Chart Config Editor\n\n| **Note:** Starting in Looker 24.10, the Chart Config Editor supports the creation of treemap charts.\n\nA treemap chart displays categorical and hierarchical data as a set of rectangles, where the size of each rectangle is determined by a numeric measure.\n\nUsing the [Chart Config Editor](/looker/docs/chart-config-editor), you can create treemap charts by starting from a [column chart](/looker/docs/column-options) in Looker. For best results, use a pivoted dimension, an unpivoted dimension, and a measure to create a treemap chart.\n\nFor example, you can create a treemap chart that shows the **Order Item Count** over several different **Category** values, pivoted by **Seasonal Collection** . Each season is represented by a color-coded rectangle, which contains smaller rectangles that represent the category. The size of each rectangle corresponds to the **Order Item Count** .\n\nPrerequisites\n-------------\n\nTo access the Chart Config Editor, you must have the [`can_override_vis_config` permission](/looker/docs/admin-panel-users-roles#can_override_vis_config).\n\n### Writing the JSON snippet\n\nTo create a treemap chart, start from the following JSON snippet: \n\n {\n chart: {\n type: 'treemap',\n }\n }\n\n### Creating a treemap chart\n\nTo create a treemap chart, follow these steps:\n\n1. View a [column chart](/looker/docs/column-options) in an Explore, or edit a column chart in a Look or dashboard.\n\n For this example, we recommend starting from a column chart with two dimensions and one measure. One dimension should be pivoted. The pivoted values define the top level categories used to render the treemap. Your starting chart might look something like this example:\n\n2. Open the **Edit** menu in the visualization.\n\n3. In the **Plot** tab, click the **Edit Chart Config** button. Looker displays the **Edit Chart Config** dialog.\n\n4. Select the **Chart Config (Override)** section, and enter the HighCharts JSON from the [Writing the JSON snippet](#json) section of this page.\n\n5. To let Looker properly format your JSON, click **\\\u003c\\\u003e (Format code)**.\n\n6. To test your changes, click **Preview**.\n\n7. To apply your changes, click **Apply**. The visualization will be displayed using the custom JSON values.\n\nOnce you've customized your visualization, you can save it."]]