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
3
votes
1 answer

jQuery and Knob animate issue

I am trying to animate a number so that it rolls into the number when the page loads. I am using another library to display a dial (http://anthonyterrien.com/knob/). The issue I am having is that the number seems to be different every time I run it.…
Serberuss
  • 2,247
  • 4
  • 22
  • 40
3
votes
1 answer

Jquery knob animate

I am having trouble animating jquery knob. As you can see in my example only the last one animates.
Johansrk
  • 5,160
  • 3
  • 38
  • 37
3
votes
1 answer

jQuery knob stop at max value

I am using jQuery knob with option data-displayPrevious=true. I need a little change in behavior: If user changes value up it should stop at maximum value and not jump to minimum after overflow maximum. And if user change value down it should stop…
Matej Chrenko
  • 188
  • 11
2
votes
1 answer

How to display value at knob chart using jquery?

How to display value that get from some URL using jQuery Knob Chart in Bootstrap 4. I got "NaN" value. (Please refer code below) How to display "-" dash symbol if the data is null. (Please refer code below) HTML
mastersuse
  • 936
  • 1
  • 15
  • 35
2
votes
2 answers

Adding knob LABEL inside jquery knob input value(not asking for percentage)

I'm using jQuery plugin called Jquery Knob to create circular progress chart. I've achieved to show value and percentage but I also want to show a label inside the knob itself.This is what I've achieved: without label and this is what I want to…
VIshal Jain
  • 622
  • 1
  • 7
  • 19
2
votes
0 answers

How to get a slideable donut chart chart using jquery knob with multiple series?

Im trying to get a donut chart with multiple series where the user can reset its shares by sliding. All other series should recalculate depending on its previous value. I've tried to fiddle around and working with values does not seems to be the…
YCuvelie
  • 87
  • 1
  • 5
2
votes
0 answers

How do i add tooltip to multilevel donut chart using Jquery Knob

I want to add tool tip on JQuery Knob Arcs. This is what I have achieved till now: $(document).tooltip({ track: true }); $('.knob').val(5).trigger('change'); $(".knob").knob({ change: function (value) { console.log("change…
2
votes
1 answer

jquery knob inner text shown as two lines

Is it possible to show the displayed number within the knob with text on a separate line break? I'm aware of the 'format' hook that can add text to the number, but would like to add a line break as well.
Steven Harlow
  • 631
  • 2
  • 11
  • 26
2
votes
1 answer

How to stop the Knob movement while moving cursor?

In my app, user(student) logins to application by just sliding the knob to right side and CLICKS, user's status switches from absent to present. It works fine on tablets. But using laptops/desktops,when student moves knob to right side with cursor,…
Baqer Naqvi
  • 6,011
  • 3
  • 50
  • 68
2
votes
1 answer

Infinite Knob on mouseover

I was trying to understand how to change the value of a knob without click and drag but with a mouseover event. Something like if the knob's handle follows the mouse. here my fiddle. http://jsfiddle.net/salvonostrato/dJ35f/1/ How can I do this? I…
SNos
  • 3,430
  • 5
  • 42
  • 92
2
votes
2 answers

jQuery knob tron skin issue

If anyone has used this plugin before : https://github.com/aterrien/jQuery-Knob im trying to apply the skin : "tron" tried to add but didnt work , also tried in the initialization code: $(".dial").knob({ …
ProllyGeek
  • 15,517
  • 9
  • 53
  • 72
2
votes
1 answer

jQuery Knob bug in Chrome

I have an issue with jQuery Knob in Google Chrome: Everything displays OK until I change the page and click the browser's back button. The percentage is repeated and the circle doesn't display until I refresh the page. Please check this link for…
2
votes
1 answer

jQuery Knob at low resolutions

I'm trying to use jQuery Knob in a mobile web app, so screen resolution of 320x480 (you can use http://www.resizemybrowser.com/ to test). However at this resolution the inner text is not displaying correctly, it's not displaying at all. I've tried…
dougzor
  • 463
  • 1
  • 5
  • 8
2
votes
3 answers

jQuery Knob 0.5 steps?

We want to use jQuery Knob to select values with steps from 0.5 we tried to configure step: .5 but it does not work. In jQuery Slider this does work this way. is it possible to use this also in Knob? What is the syntax for this? Thanks Marco
Vanes
  • 21
  • 1
  • 2
2
votes
1 answer

Using jQuery Knob as degree range input

I want to let my user input a range of degrees in a nice UI. i.e. something like 45-135 (which, in my app, actually means NE-SE wind direction...). Found jQuery Knob, but not sure how to use it to allow the value to be a range. Any idea?
shaharsol
  • 991
  • 2
  • 10
  • 31
1
2
3
9 10