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
2
votes
2 answers

Methodology to understanding JQuery plugin & API's developed by third parties

I have a question about third party created JQuery plug ins and API's and the methodology for understanding them. Recently I downloaded the JQuery Masonry/Infinite scroll plug in and I couldn't figure out how to configure it based on the…
William
  • 4,422
  • 17
  • 55
  • 108
1
vote
1 answer

Disable rounding in jQuery knob library

I have a float value, that comes from JSON data. Calling console.log() displays the correct value fe: 12.3. But I don't know why, when I try to set this value with val() it rounds the value fe: 12.0? If the value is 23.4, displays 23.0. If 31.8,…
Emile
  • 13
  • 2
1
vote
0 answers

how to bind the updated value from the input element using jquery knob through pusher in laravel?

I want to bind the updated value from tinker to the html element ..I am using PUSHER to do this in laravel..But I could n't do so . Here is my code $(document).ready(function(){ $.ajaxSetup({ headers: { 'X-CSRF-TOKEN':…
Komal Raja
  • 29
  • 4
1
vote
0 answers

jQuery Knob throwing a Uncaught TypeError: G_vmlCanvasManager.initElement is not a function

Hi and thank you in advance. I am building an app that has to display many charts in one page. I use jQuery Knob for pie charts and Echarts for Line-Charts. I have a page where I use both of these librairies and they seem to conflict each other.…
Mikko109
  • 11
  • 1
1
vote
1 answer

Using jQuery Knob I want to toggleClass when value increases

I am using the jQuery knob (http://anthonyterrien.com/knob/) and trying to trigger a 'toggleClass' event on a series of divs when the value of the dial is >=10, >=20, >=30 etc Using this I can see the value in the console $(".dial").knob({ …
Andy Ward
  • 73
  • 7
1
vote
1 answer

Add jQuery-Knob in Angular 2

I am new to Angular 2.0 and using aspnetboilerplate template. I am trying to integrate jQuery-Knob. First, I included jquery.knob.min.js in scripts in .angular-cli.json: "scripts": [ "../src/bsb-theme/js/jquery.validate.js", …
Nighil
  • 4,099
  • 7
  • 30
  • 56
1
vote
2 answers

Unable to use jQuery plugin placed in the Ruby on Rails vendor folder

I am trying to use the jQuery library Knob to create a functioning dial/meter system for an interactive optimization system. I've added the library to my vendor folder and included the vendor javascripts folder in my…
user7630939
1
vote
1 answer

prevent manual input on jquery-knob

I am using Jquery-Knob as a control knob to choose values from an array, I use the input as the index of the array and I show other info as the label. $(".dial").knob({ displayPrevious : true, 'min':0, 'max':…
distante
  • 6,438
  • 6
  • 48
  • 90
1
vote
1 answer

Formatting value label to fit without being cut off

I've got an issue where i'm automatically formatting my jQuery.Knob instance and it's being cut off incorrectly. It ends up looking like this: etc.... This slider just goes up in range (max will be around $10,000,000, potentially more), so you…
Darren
  • 13,050
  • 4
  • 41
  • 79
1
vote
1 answer

Knob circular progress bar with ajax

I am trying to use Knob with AJAX, and it is working, but the progress bar is not changing, only the number inside real time. You can check it here: www.skincannon.com The code is: HTML:
Marias
  • 17
  • 5
1
vote
0 answers

How to integrate: Knob.js + Polymer 1.0 + Custom Script?

im new in Polymer & Java. Right now im trying to set up a site which is build of Polymer 1.0, a custom java script (https://github.com/ztizzlegaming/CSGOWinBig/blob/master/src/script.js) and Knob.js by aterrien…
1
vote
1 answer

Multi-knob with jquery - Square canvas

I have a problem with jQuery Knob when I use multi-knob. I have 3 knobs which looks like "the unreadable clock" of this demo (the problem is in the demo too) :- http://anthonyterrien.com/knob/ This works, but the canvas are square. The clickable…
Rémi Girard
  • 305
  • 3
  • 10
1
vote
2 answers

Highcharts full circle gauge as in Knob js

Is there any simple example (preferibly with a JSFiddle) for an implementation of a full circle gauge with Highcharts like the one below from jQuery knob ? Here is what I ve got so far : http://jsfiddle.net/skeletorkun/grn5o39e/1/ $(function () { …
Orkun
  • 6,998
  • 8
  • 56
  • 103
1
vote
2 answers

Adding CSS to Jquery knob?

I have 2 questions. Firstly, how do you go about changing the CSS for a knob? I've tried adding a class to it but that didn't seem to work. Neither did doing inline styling. Anyone have any clue how this can be done (An example would be…
andofcourse
  • 79
  • 2
  • 9
1
vote
1 answer

JQuery Knob - number format

I need to format the input value, the number in the center of the knob. I've tried to incorporate the following format code, in different places both in the .js and .html files , without success: .toLocaleString('no-NOK'); My HTML:
XhebbsX
  • 11
  • 1
1 2
3
9 10