Vue UI Components Documentation
The Vue TreeMap displays hierarchical data as a set of nested rectangles. This guide adds the Vue TreeMap (jqxTreeMap) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-scriptsjqwidgets-scripts/jqwidgets-vue3/vue_jqxtreemap.vue 
In a Vue 3 project (to start one, see Getting started with Vue), add the package:
npm install jqwidgets-scripts
import JqxTreeMap from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxtreemap.vue';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.tailwind-blue-dark.css';
With <script setup>, an imported component is ready to use in the template. jqx.base.css is required; the second file is a theme, selected with the theme attribute.
The Automatic Rendering demo as a Single-File Component:
<template>
<JqxTreeMap
:width="850"
:height="400"
:colorRange="100"
:colorMode="'autoColors'"
:baseColor="'#52CBFF'"
:legendScaleCallback="legendScaleCallback"
:legendLabel="'Olympic medal count - London 2012'"
:source="data"
>
</JqxTreeMap>
</template>
<script setup>
import JqxTreeMap from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxtreemap.vue';
let legendScaleCallback = (v) => {
v = v.toFixed(1);
return v;
};
let data = [
{ label: 'USA', value: 104 },
{ label: "People's Republic of China", value: 88 },
{ label: 'Great Britain', value: 65 },
{ label: 'Russian Federation', value: 82 },
{ label: 'Germany', value: 44 },
{ label: 'Republic of Korea', value: 28 },
{ label: 'France', value: 34 },
{ label: 'Italy', value: 28 },
{ label: 'Hungary', value: 17 },
{ label: 'Australia', value: 35 },
{ label: 'Japan', value: 38 },
{ label: 'Kazakhstan', value: 13 },
{ label: 'Netherlands', value: 20 },
{ label: 'Ukraine', value: 20 },
{ label: 'New Zealand', value: 13 },
{ label: 'Cuba', value: 14 }
];
</script>
<style>
.jqx-treemap-legend {
}
</style>
Options are attributes. Bind values from the script with :, for example :width="850".
Listen to an event with @ and its name. For example, bindingComplete: This event is triggered when the jqxTreeMap's source property is set to point to jqxDataAdapter instance and the jqxDataAdapter's binding is finished.
<script setup>
function onBindingComplete(event) {
console.log(event.args);
}
</script>
<template>
<JqxTreeMap @bindingComplete="onBindingComplete" />
</template>
Call methods through a template ref. For example, destroy: Destroy the jqxTreeMap widget.
<script setup>
import { ref, onMounted } from 'vue';
const myTreeMap = ref(null);
onMounted(() => {
myTreeMap.value.destroy();
});
</script>
<template>
<JqxTreeMap ref="myTreeMap" />
</template>
Every component also has setOptions({ … }) and getOptions('name').