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

unable to show a knob pie chart inside my page, the pie chart is now showing

I want to add a count down pie charts inside our web page,and the pie charts will show the renaming time for our projects in the following format:- **Project A** starts in 3 weeks and 3 days **Project B** starts in 1 month and 2 weeks here is the…
John John
  • 1
  • 72
  • 238
  • 501
0
votes
0 answers

How to add jquery knob in div tag in html

I have the below index.html code Myapp
0
votes
0 answers

Jquery-knob.js throwing error G_vmlCanvasManager.initElement is not a function

I'm using jquery.knob.js in angular application. I included the scripts in angular-cli.json like this. "scripts": [ "assets/app/vendors/js/vendors.min.js", "assets/js/jquery.knob.min.js", …
yer
  • 1,454
  • 2
  • 16
  • 33
0
votes
1 answer

JQuery Knob Forwards and Backwards

I have a JQuery knob that's displaying a value that can range from -5000 to 5000. I want it to have 0 be straight up, highlight going cw if the value is positive, highlight going ccw if the value is negative. Is there a simple way to do this with…
vkapadia
  • 290
  • 1
  • 6
  • 17
0
votes
1 answer

How to add text inside a jquery Knob?

This is my code where i am using data-prepend="abc" inside the input tag but it is not working. How can I add text inside the knob above percentage value?
Sho_alam
  • 5
  • 4
0
votes
0 answers

jQuery .trigger('change') triggers jQuery-knob release-function

I'm creating a web interface on my Raspberry Pi 3 running with NodeJS. My problem is that when a second client connects my serverside socket.on volumeCheck broadcasts the volume value to all clients which triggers the clientside socket.on…
0
votes
0 answers

knob js animation value (transition)

I use knob js. This is readOnly, I would like to come up with the value and bar animation when the page first opens. this is my code: enter image description here result: enter image description here
user7203953
0
votes
1 answer

Different value in ui-knob bar and center value

I am using ng-knob library to draw some charts in my angular project, the charts load perfectly, but I have a new requirement that is put different values for the text showed in the donut center and value in the progress bar of the chart. In the…
xzegga
  • 3,051
  • 3
  • 25
  • 45
0
votes
1 answer

How to use jqueryKnob's tron skin?

Well this is my first use of the jqueryKnob plugin. I am trying to use the format option and the skin option in this plugin but it doesnt seem to work. For the skin issue I tried jQuery knob tron skin issue but was of no help. Where am I possibly…
Ayan
  • 2,738
  • 3
  • 35
  • 76
0
votes
2 answers

NaN Jquery knob

I am trying to remove the NaN showing on my jquery knob. I have tried a few thing such as setting a timeout and adjust the count down timer. How can I fix my knob so it no longer shows NaN when first called? example…
0
votes
1 answer

How do I call a global function in jquery/coffeescript

class Dashing.Hacircledimmer extends Dashing.Widget setLevel: -> levelToSet = '10' $.post '/homeassistant/dimmerLevel', widgetId: @get('id'), command: levelToSet, (data) => json = JSON.parse data ready: -> …
Frameone
  • 33
  • 5
0
votes
1 answer

JQuery Knob - Timer with format HH:mm:dd

I'm trying to set a timer with format HH:mm:dd. Ex: The time will show "22:25:05" or "00:04:22" with the Horus/minutes/seconds left. I manged to get it to show the time, but can't make the timer work and do live countdown. How could i set a timer…
BenB
  • 2,747
  • 3
  • 29
  • 54
0
votes
0 answers

knob: dynamic value change - is not triggering

i have created a circle with jquery-knob. . Now if I want to change the value, right after I created the circle, my circle is: $(".timecycle").knob({ min: 0,max: 50,width: 292,height: 292,fgColor:…
0
votes
1 answer

jquery knob not updating via webbsockets

I am getting the knob value via websockets and am able to display the value on the html page via document.elementId.. However I then try to update the knob based on this value and it does not occur …
0
votes
2 answers

jQuery knob - Rendering issues

I'm trying to use a jquery knob in angular, and i've created a directive in order to use it. Now, i've seen many jquery knob examples, and in most of them, there's the current value displayed in the centre of the dial...but not in my case! And also,…
Nick
  • 13,493
  • 8
  • 51
  • 98