Questions tagged [jquery-knob]

An jQuery-based spinner/dial control.

jQuery Knob canvas based ; no png or jpg sprites. touch, mouse and mousewheel, keyboard events implemented. downward compatible ; overloads an input element.

Useful links:

Example

<input type="text" value="75" class="dial">

$(function() {
    $(".dial").knob();
}

enter image description here

Options

Options are provided as attributes 'data-option':

<input type="text" class="dial" data-min="-50" data-max="50">

... or in the "knob()" call :

$(".dial").knob({
                'min':-50
                ,'max':50
                })

The following options are supported :

  • Behaviors :

    • min : min value | default=0.
    • max : max value | default=100.
    • angleOffset : starting angle in degrees | default=0.
    • angleArc : arc size in degrees | default=360.
    • stopper : stop at min & max on keydown/mousewheel | default=true.
    • readOnly : disable input and events | default=false.

  • UI :
    • cursor : display mode "cursor" | default=gauge.
    • thickness : gauge thickness.
    • width : dial width.
    • displayInput : default=true | false=hide input.
    • displayPrevious : default=false | true=displays the previous value with transparency.
    • fgColor : foreground color.
    • bgColor : background color.

  • Hooks

    $(".dial").knob({ 'release' : function (v) { /make something/ } });

  • 'release' : executed on release

    Parameters :

    value : int, current value


- 'change' : executed at each change of the value
Parameters :

value : int, current value
'draw' : when drawing the canvas


The scope (this) of each hook function is the current Knob instance (refer to the demo code).

Example

<input type="text" value="75" class="dial">

<script>
$(".dial").knob({
                 'change' : function (v) { console.log(v); }
                });
</script>

Dynamically configure

<script>
$('.dial')
    .trigger(
        'configure',
        {
        "min":10,
        "max":40,
        "fgColor":"#FF0000",
        "skin":"tron",
        "cursor":true
        }
    );
</script>

Set the value

<script>
$('.dial')
    .val(27)
    .trigger('change');
</script>

Supported browser Tested on Chrome, Safari, Firefox, IE 9.0.

145 questions
0
votes
1 answer

Jquery Knob Change Size on Browser Resize

i'm currently looking for an solution to change the size of my Jquery Knob Chart when the user resize the browser. Till now i only found a solution : reload the site on Resize and check Browser width and set the height and width based on this. But…
xNiceEinz
  • 53
  • 10
0
votes
0 answers

I am using knob.js jquery plugin. I want to set the minimum value of the widget to 100

I am using knob.js jquery plugin. I want to set the minimum value of the widget to 100 (i.e i want to display full circle) but the input value must be displayed as 1 or 2 Jquery plugin link : http://anthonyterrien.com/knob/ Check about us section…
SurajP
  • 31
  • 1
  • 1
  • 2
0
votes
1 answer

How to implement multiple arch on single canvas with jquery knob?

I am referring jsfiddle for reference. In this blue arch is reducing with knob but other arch are not working with knob. Can any one please suggest any reference for this. [Canvas][1] [1]: http://jsfiddle.net/matthias_h/L5auuagc/enter code here
user1696958
  • 21
  • 1
  • 2
0
votes
1 answer

Draw circle cursor in jquery knob

I want to do something like this image but I don't know how. Please help me and show me the path to draw circle cursor in knob plugin. Thanks in advance
0
votes
1 answer

jQuery Knob won't display correctly

All I get when I use this below is a text box with a number in it..... What did I do wrong ? Aren't I supposed to get the circular bars around it? I've tried every browser none works. All I get is shown in this picture…
candyfreak
  • 13
  • 4
0
votes
1 answer

How to get the value from knob.js

I've searched for information to solve my problem with the JQuery Plugin named knob.js, but couldn't find anything which helps me. Here are links to the plugin: https://github.com/aterrien/jQuery-Knob http://anthonyterrien.com/knob/ My problem is:…
Rob
  • 11
  • 1
0
votes
1 answer

wrong value passed to format hook function after set value , jQuery Knob

I am using jQuery knob, and I have below code: var knobOption={//ref: https://github.com/aterrien/jQuery-Knob 'min':0, 'max':1, 'width':100, 'height':100, 'thickness':0.1, 'readOnly':true,//READ ONLY 'fgColor':…
JaskeyLam
  • 15,405
  • 21
  • 114
  • 149
0
votes
1 answer

jQuery Knob format causing scroll issue

I'm using the jQuery Knob plugin but need the displayed value to be in pound sterling. Ideally this will look like £123456. However, when I use the 'format' hook to add the £ sign it no longer allows me to set the value by scrolling the mousewheel…
0
votes
0 answers

Jquery knob animate when page scrolled to the knob section in Bootstrap

After lots of search with no luck. I am deciding to post here. I am using jquery knob to show some charts. And also want to animate the animation is done and working good. But i want to animate on page scroll using jquery smooth scroll plugin. for…
CodeBriefly
  • 1,000
  • 4
  • 16
  • 29
0
votes
2 answers

How to change text inside JQuery knob

I want to change the text of JQuery Knob. For example I have a rate 23% consumed I want to put 23% on row and consumed in new row inside the circle. In other word, I want to add (consumed) under the percentage in different style (The font size of…
M Muneer
  • 377
  • 4
  • 17
0
votes
1 answer

jquery knob display input on complete

I'm using jquery knob to graphically represent my data. https://github.com/aterrien/jQuery-Knob I'm trying to show the input value (in the center of the circle) only after the animation, but I didn't found how. My aproach was to initially…
Emilio
  • 1,024
  • 4
  • 16
  • 33
0
votes
1 answer

jQuery-Knob to control web audio api panning

So I have a panning feature with a basic HTML input range I am using the following javascript code to control the panning: var x = this.valueAsNumber, y = 0, z = 1 - Math.abs(x); panner2.setPosition(x,y,z); Any idea how to implement it with…
boombap123
  • 107
  • 1
  • 10
0
votes
1 answer

jQuery-Knob: is it possible to have a range?

I am trying to use jQuery Knob for a thermostat UI. I would like to allow for the ability to control a range (heat - cool). I've been able to achieve this look by stacking several knobs, however, this essentially disabled the clicking/dragging…
0
votes
2 answers

Why doesn't the background color of the knob load before click? [Angular.js]

I will keep this simple. You can check this fiddle here jsfiddle. Here when you load the knob, the color of the knob only gets updated on clicking/scrolling over it (the number changes and hence colors up). I have this same problem on my project and…
Thomas Sebastian
  • 1,582
  • 5
  • 18
  • 38
0
votes
0 answers

jQuery Knob max values

I have the following JS code $(document).ready(function(){ $('.dial').each(function () { var elm = $(this); var color = elm.attr("data-fgColor"); var perc = elm.attr("value"); elm.knob({ 'value': 0, 'min':0, …
Lee_S_666
  • 25
  • 1
  • 9