jqwidgets-framework
Version:
jQWidgets is an advanced Angular, Vue, Blazor, React, Web Components, jquery, ASP .NET MVC, Custom Elements and HTML5 UI framework.
100 lines (86 loc) • 3.48 kB
HTML
<html lang="en">
<head>
<title id='Description'>This demo illustrates legend positions.</title>
<meta name="keywords" content="jQuery Heatmap, Heatmap, Legend Positions" />
<link rel="stylesheet" href="../../../jqwidgets/styles/jqx.base.css" type="text/css" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" />
<script type="text/javascript" src="../../../scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../../scripts/demos.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxheatmap.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxscrollbar.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxlistbox.js"></script>
<script type="text/javascript" src="../../../jqwidgets/jqxdropdownlist.js"></script>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
}
#heatmap {
width: 100%;
max-width: 1000px;
}
#legend-position {
display: flex;
align-items: center;
margin: 50px 100px;
}
#jqxdropdownlist {
margin-left: 20px;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
var xAxis = {
labels: ['John', 'Marry', 'Alba', 'Steven', 'Josh', 'Alica', 'Robert', 'Kim', 'Ann', 'Paul', 'Regina', 'Dorothy']
};
var yAxis = {
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri']
};
var data = [
[89, 39, 94, 55, 3],
[53, 38, 26, 68, 33],
[22, 0, 66, 90, 78],
[97, 68, 68, 3, 99],
[47, 47, 88, 6, 1],
[73, 23, 3, 79, 100],
[21, 86, 13, 33, 0],
[53, 81, 95, 79, 66],
[74, 68, 88, 51, 43],
[10, 12, 78, 14, 21],
[55, 58, 12, 82, 99],
[88, 23, 86, 59, 53],
];
$("#heatmap").jqxHeatMap({
xAxis: xAxis,
yAxis: yAxis,
source: data,
title: 'Car sales revenue per employee(in 1000 €)',
});
var source = ["Right", "Left", "Top", "Bottom"];
$("#jqxdropdownlist").jqxDropDownList({
source: source,
width: '100px',
selectedIndex: 0,
autoDropDownHeight: true
});
$("#jqxdropdownlist").on('change', function (event) {
var value = event.args.item.value;
$("#heatmap").jqxHeatMap('setLegendPosition', value);
});
});
</script>
</head>
<body class='default'>
<div id="heatmap"></div>
<div id="legend-position">
<label for="jqxdropdownlist">Legend Position:</label>
<div id='jqxdropdownlist'></div>
</div>
</body>
</html>