UNPKG

jqwidgets-framework

Version:

jQWidgets is an advanced jQuery, Angular, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.

112 lines (107 loc) 4.79 kB
<!DOCTYPE html> <html lang="en"> <head> <title id='Description'>Custom Element Knob KnobRotation</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="This is an example of Custom Element Knob's counter clockwise rotation." /> <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/jqxknob.js"></script> <script type="text/javascript" src="..//jqwidgets/jqxnumberinput.js"></script> <script type="text/javascript" src="../scripts/demos.js"></script> <style> .jqx-knob-label { fill: #a2da39; font-size: 14px; font-weight: bold; } </style> <script> window.onload = function() { var myKnob = document.createElement('jqx-knob'); myKnob.settings = { value: 60, min: 0, max: 100, startAngle: 120, endAngle: 480, rotation: 'counterclockwise', dragStartAngle: 120, dragEndAngle: 420, snapToStep: true, marks: { colorRemaining: '#fff', colorProgress: '#fff', type: 'line', offset: '75%', thickness: 2, size: '15%', majorSize: '15%', drawAboveProgressBar: true, majorInterval: 10, minorInterval: 2 }, progressBar: { size: '15%', offset: '75%', style: { stroke: '#a2da39', strokeWidth: 1, fill: '#a2da39' }, background: { stroke: '#d1d2d4', strokeWidth: 1, fill: '#d1d2d4' } }, dial: { innerRadius: '0%', // specifies the inner Radius of the dial outerRadius: '65%', // specifies the outer Radius of the dial style: { stroke: '#ff0000', strokeWidth: 1, fill: { color: '#66707e', gradientType: 'linear', gradientStops: [[0, 1], [50, 0.4], [100, 1]] } } }, labels: { offset: '50%', rotate: true, step: 10 }, spinner: { size: '70%', innerRadius: '60%', // specifies the inner Radius of the dial outerRadius: '65%', // specifies the outer Radius of the dial marks: { colorRemaining: '#d5d3d4', colorProgress: '#d5d3d4', type: 'line', offset: '60%', thickness: 1, size: '5%', majorSize: '5%', majorInterval: 10, minorInterval: 2 }, style: { stroke: '#d5d3d4', strokeWidth: 1, fill: { color: '#dfe3e9', gradientType: 'linear', gradientStops: [[0, 0.5], [50, 0.5], [100, 0.5]] } } }, pointer: { type: 'arrow', style: { fill: '#a2da39' }, size: '55%', thickness: 5, offset: '0%' } }; document.querySelector('#container').appendChild(myKnob); } </script> </head> <body> <div class="example-description"> Custom element Knob with Counter Clockwise Rotation. </div> <div id='container'> </div> </body> </html>