jqwidgets-framework
Version:
jQWidgets is an advanced jQuery, Angular, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
81 lines (69 loc) • 3.31 kB
HTML
<html lang="en">
<head>
<title id='Description'>Custom Element Gauge FluidSize</title>
<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" />
<meta name="description" content="Custom Elements Gauge Fluid Size Example. The width and height of the Gauge are set in Percentages." />
<link rel="stylesheet" href="../jqwidgets/styles/jqx.base.css" type="text/css" />
<link rel="stylesheet" href="../styles/demos.css" type="text/css" />
<script type="text/javascript" src="../scripts/webcomponents-lite.min.js"></script>
<script type="text/javascript" src="../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../jqwidgets/jqxcore.elements.js"></script>
<script type="text/javascript" src="../jqwidgets/jqxdraw.js"></script>
<script type="text/javascript" src="../jqwidgets/jqxgauge.js"></script>
<script type="text/javascript" src="../jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="../scripts/demos.js"></script>
<style>
html, body {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
</style>
<script type="text/javascript">
var labels = { visible: true, position: 'inside' };
JQXElements.settings['GaugeSettings'] =
{
ranges:
[
{ startValue: 0, endValue: 55, style: { fill: '#4bb648', stroke: '#4bb648' }, endWidth: 5, startWidth: 1 },
{ startValue: 55, endValue: 110, style: { fill: '#fbd109', stroke: '#fbd109' }, endWidth: 10, startWidth: 5 },
{ startValue: 110, endValue: 165, style: { fill: '#ff8000', stroke: '#ff8000' }, endWidth: 13, startWidth: 10 },
{ startValue: 165, endValue: 220, style: { fill: '#e02629', stroke: '#e02629' }, endWidth: 16, startWidth: 13 }
],
ticksMinor: { interval: 10, size: '5%' },
ticksMajor: { interval: 20, size: '9%' },
value: 0,
colorScheme: 'scheme05',
animationDuration: 1200,
width: '60%',
height: '80%'
};
window.onload = function() {
var myGauge = document.querySelector('jqx-gauge');
var myButton = document.querySelector('jqx-button');
var count = 0;
myButton.addEventListener('click', function() {
count++;
if (count % 2 == 0) {
myGauge.width = 200;
myGauge.height = 300;
} else {
myGauge.width = 400;
myGauge.height = 500;
}
});
}
</script>
</head>
<body>
<div class="example-description">
This demo shows Custom Elements Gauge's width and height set in percentages.
</div>
<jqx-gauge settings="GaugeSettings"></jqx-gauge>
<jqx-button>Change Size</jqx-button>
</body>
</html>