Building on the Quick Start example, you can change the labels, tick marks, pointer, background, and the scale of values for the gauge using the labels, tickMajor, tickMinor, pointer, face, and ranges options.
Drop down and copy script to paste in <head> section
Script |
Copy Code |
---|---|
<script type="text/javascript"> $(document).ready(function () { $("#lineargauge1").wijlineargauge({ width: 400, height: 120, value: 70, max: 100, min: 0, animation: { enabled: true, duration: 400, easing: ">" }, labels: { style: { fill: "#1E395B", "font-size": 12, "font-weight": "800" } }, tickMajor: { position: "inside", offset: -11, interval: 20, factor: 12, style: { fill: "#1E395B", stroke: "none", width: 2 } }, tickMinor: { position: "inside", offset: -11, visible: true, interval: 4, factor: 10, style: { fill: "#1E395B", stroke: "none", width: 1 } }, pointer: { shape: "rect", length: 0.6, style: { fill: "#1E395B", stroke: "#7BA0CC", "stroke-width": 1, opacity: 1 } }, face: { style: { fill: "270-#FFFFFF-#D9E3F0", stroke: "#7BA0CC", "stroke-width": 2 } }, ranges: [{ startValue: 80, endValue: 100, //A ratio value that determines the location of the beginning of the range. startDistance: 0.85, //A ratio value that determines the location of the end of the range. endDistance: 0.85, startWidth: 0.5, endWidth: 0.5, style: { fill: "90-#3DA1D8-#3A6CAC", opacity: 1, stroke: "none" } }] }); $("#slider").slider({ value: $("#lineargauge1").wijlineargauge("option", "value"), change: function (event, ui) { $("#lineargauge1").wijlineargauge("option", "value", ui.value); } }); }); </script> |
Drop down and copy markup to paste in the <body> section
Markup |
Copy Code |
---|---|
<div id="lineargauge1" style="width:400px"></div> <p>Drag and release the slider to change the gauge's value.</p> <div id="slider" style="width:400px"></div> |