jQuery TreeMap Small
Set the renderCallbacks property of the jqxTreeMap. Author: http://jqwidgets.com
by Nalin Sajwan
HTML
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<div id="treemap"></div>
JavaScript
var data = [{
label: 'Chrome',
value: 44.06,
color: "#37c837"
}, {
label: 'Internet Explorer',
value: 22.08,
color: "#0066ff"
}, {
label: 'Firefox',
value: 18.17,
color: "#ed7b0f"
}, {
label: 'Others',
value: 9.07,
color: "#818181"
}, {
label: 'Opera',
value: 3.38,
color: "#9a0900"
}, {
label: 'Safari',
value: 3.24,
color: "#4dbff1"
}];
$('#treemap').jqxTreeMap({
width: 400,
height: 300,
source: data,
renderCallbacks: {
'*': function (element, data) {
element.css({
color: '#ffffff'
});
element.html('<span style="font-size: 11px;" class="jqx-treemap-label">' + data.label + ', ' + data.value + '%</span>');
return true;
}
}
});