%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
| Server IP : 14.207.165.8 / Your IP : 216.73.216.26 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/thread-self/root/var/www/html/ppaobm/vendor/bower-asset/chartjs/samples/legend/ |
Upload File : |
<!doctype html>
<html>
<head>
<title>Legend Callbacks</title>
<script src="../../dist/Chart.min.js"></script>
<script src="../utils.js"></script>
<style>
body, html {
height: 100%;
font-family: sans-serif;
}
canvas{
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
#log {
position: absolute;
right: 0;
top: 0;
bottom: 0;
background-color: #EEE;
float: right;
width: 20%;
padding: 8px;
overflow-y: auto;
white-space: pre;
line-height: 1.5em;
}
</style>
</head>
<body>
<div id="log"></div>
<div style="width:75%;">
<canvas id="canvas"></canvas>
</div>
<script>
var logEntry = 1;
var logElement = document.getElementById('log');
var utils = Samples.utils;
var inputs = {
min: 20,
max: 80,
count: 8,
decimals: 2,
continuity: 1
};
var config;
function log(text) {
logElement.innerText += logEntry + '. ' + text + '\n';
logElement.scrollTop = logElement.scrollHeight;
logEntry++;
}
function generateData() {
return utils.numbers(inputs);
}
function generateLabels() {
return utils.months({count: inputs.count});
}
utils.srand(42);
config = {
type: 'line',
data: {
labels: generateLabels(),
datasets: [{
label: 'My First dataset',
backgroundColor: utils.color(0),
borderColor: utils.color(0),
data: generateData(),
fill: false,
}, {
label: 'My Second dataset',
fill: false,
backgroundColor: utils.color(1),
borderColor: utils.color(1),
data: generateData(),
}]
},
options: {
legend: {
onHover: function(event, legendItem) {
log('onHover: ' + legendItem.text);
},
onLeave: function(event, legendItem) {
log('onLeave: ' + legendItem.text);
},
onClick: function(event, legendItem) {
log('onClick:' + legendItem.text);
}
},
title: {
display: true,
text: 'Chart.js Line Chart'
},
scales: {
xAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'Month'
}
}],
yAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'Value'
}
}]
}
}
};
new Chart(document.getElementById('canvas'), config);
</script>
</body>
</html>