【问题标题】:Gradient color in Gauge.js not workingGauge.js中的渐变颜色不起作用
【发布时间】:2013-12-30 10:17:19
【问题描述】:

我正在尝试使用Gauge.js 来实现仪表。我想用渐变色来实现它。

我在实现这一点时遇到了一些问题。

我目前实施的仪表屏幕截图:

1) 渐变色不起作用

我的脚本:

<script type="text/javascript">
var opts = {
  lines: 30, // The number of lines to draw
  angle: 0.3, // The length of each line
  lineWidth: 0.1, // The line thickness
  pointer: {
    length: 0.9, // The radius of the inner circle
    strokeWidth: 0.035 // The rotation offset
  },
  limitMax: true,   // If true, the pointer will not go past the end of the gauge
  colorStart: '#64A9CC',   // Colors
  colorStop: '#F6735E',    // just experiment with them
  strokeColor: '#000000',   // to see which ones work best for you
  generateGradient: 'true'
};
var target = document.getElementById('gauge'); // your canvas element
var gauge = new BaseDonut(target).setOptions(opts); // create sexy gauge!
gauge.maxValue = 100; // set max gauge value
gauge.animationSpeed = 32; // set animation speed (32 is default value)
gauge.set(50); // set actual value
</script>

曲线看起来也有点模糊。有什么建议吗?

【问题讨论】:

    标签: jquery gauge jsgauge


    【解决方案1】:

    你可以试试 jqChart 的仪表。它很好地支持渐变。 这是一个例子 - http://www.jqchart.com/jquery/gauges/RadialGauge/Gradients

    免责声明:我为 jqChart 工作。

    最好的问候, 马克西姆·米利夫

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-06-05
      • 1970-01-01
      • 2019-02-22
      • 2021-07-20
      • 1970-01-01
      • 1970-01-01
      • 2019-10-06
      相关资源
      最近更新 更多