使用jsgauge创建量规 [英] Create a gauge using jsgauge

查看:54
本文介绍了使用jsgauge创建量规的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用jsgauge插件创建了一个量规

I have created a gauge using jsgauge plugin

我无法控制针的速度.它应比默认速度慢一些,移到分配的值.指针也应从0开始.

What I am not able to do is to control the speed of the needle. It should move to the assigned value a bit slower than the default speed. The needle should also start from 0.

此小提琴是 http://jsfiddle.net/aryan7987/h45Tr/2/

Query(document).ready(function(){
        jQuery("#example")
          .gauge({
             min: 0,
             max: 100,
             label: 'EMPLOYEE',
             startangle: 0,
             bands: [{color: "#ff0000", from: 90, to: 100}]
           })
          .gauge('setValue', 59);
        });

推荐答案

不幸的是,看起来好像是通过定义每帧的增量来对速度进行硬编码的.这是一个猴子补丁版本,用于更改速度请参阅此jsfiddle

Unfortunately it looks like the speed is hardcoded by defining the delta for each frame. Here is an monkey patched version to change the speed see this jsfiddle

问题行是:

increment = Math.max(Math.abs( that.settings.pointerValue - pointerValue ) / 8, 3);

这篇关于使用jsgauge创建量规的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆