- canvas based ; no png or jpg sprites.
- touch, mouse and mousewheel, keyboard events implemented.
- downward compatible ; overloads an input element.
Requirements ¶
Yii 1.1.13 (Not tested in others)
Usage ¶
Drop this in your extension directory and then call the widget somewhere (in your layout, ...).
Behaviors :
- min : min value | default=0.
- max : max value | default=100.
- step : step size | default=1.
- 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", cursor size could be changed passing a numeric value to the option, default width is used when passing boolean value "true" | default=gauge.
- thickness : gauge thickness.
- lineCap : gauge stroke endings. | default=butt, round=rounded line endings
- width : dial width.
- displayInput : default=true | false=hide input.
- displayPrevious : default=false | true=displays the previous value with transparency.
- fgColor : foreground color.
- inputColor : input value (number) color.
- font : font family.
- fontWeight : font weight.
- bgColor : background color.
// you can use all options(above) in this format from http://anthonyterrien.com/knob/
// 'data-width'=>'150'
// 'data-cursor'=>true
// 'data-thickness'=>.3
// 'data-fgColor'=>'#222222'
// 'data-displayInput'=>false
// 'data-displayPrevious'=>true
// 'data-min'=>'-100'
// 'data-max'=>'15000'
// 'data-angleOffset'=>90
// 'data-linecap'=>'round'
// 'data-angleArc'=>250
// 'data-step'=>'1000'
// 'data-skin'=>'tron'
$this->widget('ext.knob.knob', array(
'data' => array(
'data-width' => '200',
'value' => '35',
'data-fgColor' => '#222222',
'data-min' => '-100',
'data-fgColor' => '#66CC66',
'data-angleArc' => 250,
'data-skin' => 'tron' //
),
)
);
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.