jQWidgets jqxGauge LinearGauge rangeOffset属性

jQWidgets jqxGauge LinearGauge rangeOffset属性

jQWidgets是一个基于jQuery的UI组件库,提供了丰富的UI组件和工具,包括表格、图表、日历、单等。jqxGaugejqxLinearGaugejQWidgets中的两个组件,用于显示仪表盘和性仪盘。这两个组件都提供了rangeOffset属性,用于设置范围的偏移量。

rangeOffset属性的基本语法

rangeOffset属性用于设置范围的偏移量。其基本语法如下:

// 设置仪表盘范围偏移量
$('#jqxGauge').jqxGauge({
  ranges: [
    { startValue: 0, endValue: 50, style: { fill: '#4cb848', stroke: '#4cb848' }, startDistance: 0, endDistance: 0 },
    { startValue: 50, endValue:90, style: { fill: '#fad00b', stroke: '#fad00b' }, startDistance: 0, endDistance: 0 },
    { startValue: 90, endValue: 100, style: { fill: '#e00000', stroke: '#e00000' }, startDistance: 0, endDistance: 0 }
  ],
  rangeOffset: 0
});

// 设置线性仪表盘范围偏移量
$('#jqxLinearGauge').jqxLinearGauge({
  ranges: [
    { startValue: 0, endValue: 30, style: { fill: '#4cb848', stroke: '#4cb848' }, startDistance: '0%', endDistance: '25%' },
    { startValue: 30, endValue: 70, style { fill: '#fad00b', stroke: '#fad00b' }, startDistance: '0%', endDistance: '25%' },
    { startValue: 70, endValue: 100, style: { fill: '#e00000', stroke:e00000' }, startDistance: '0%', endDistance: '25%' }
  ],
  rangeOffset: '0%'
});

jqxGaugejqxLinearGauge组件中,可以使用rangeOffset属性来设置范围的偏移量。

示例1:设置jqxGauge范围偏移量

以下是一个示例,演示如何使用rangeOffset属性设置jqxGauge的范围偏移量:

<!DOCTYPE html>
<html>
<head>
  <meta charsetUTF-8">
  <title>jQWidgets Gauge Example</title>
  <link rel="stylesheet" href="https://cdn.jqwidgets.com/jquery.jqwidgets/4.5.3/jqwidgets/styles/jqx.base.css">
  <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  <script src="https://cdn.jqwidgets.com/jquery.jqwidgets/4.5.3/jqwidgets/jqxcore.js"></script>
  <script src="https://cdn.jqwidgets.com/jquery.jqwidgets/4.5.3/jqwidgets/jqxdata.js"></script>
  <script src="https://cdn.jqwidgets.com/jquery.jqwidgets/4.5.3/jqwidgets/jqxbuttons.js"></script>
  <script src="https://cdn.jqwidgets.com/jquery.jqwidgets4.5.3/jqwidgets/jqxgauge.js"></script>
</head>
<body>
  <div id="jqxGauge"></div>
  <script>
    $(document).ready(function () {
      $('#jqxGauge').jqxGauge({
        ranges: [
          { startValue: 0, endValue: 50, style: { fill: '#4cb848', stroke: '#4cb848' }, startDistance: 0, endDistance: 0 },
          { startValue: 50, endValue: 90,: { fill: '#fad00b', stroke: '#fad00b' }, startDistance: 0, endDistance: 0 },
          { startValue: 90, endValue: 100, style: { fill: '#e00000', stroke: '#e00000' }, startDistance: 0, endDistance: 0 }
        ],
        rangeOffset: 0,
        value: 75
      });
    });
  </script>
</body>
</html>

在这个示例中,我们使用jqxGauge组件创建了一个仪表盘,并使用rangeOffset属性设置了范围的偏移量为0。

示例2:设置jqxLinearGauge范围偏移量

以下是另一个示例,演示如何使用rangeOffset属性设置jqxLinearGauge的范围偏移量:

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>jQWidgets LinearGauge Example</title>
  <link rel="stylesheet" href="https://cdn.jqwidgets.com/jquery.jqwidgets/4.5.3/jqwidgets/styles/jqx.base.css">
  <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  <script src="https://cdn.jqwidgets.com/jquery.jqwidgets/4.5.3/jqwidgets/jqxcore.js"></script>
  <script src="https://cdn.jqwidgets.com/jquery.jqwidgets/4.5.3/jqwidgets/jqxdata.js"></script>
  <script src="https://cdn.jqwidgets.com/jquery.jqwidgets/4.5.3/jqwidgets/jqxbuttons.js"></script>
  <script src="https://cdn.jqwidgets.com/jquery.jqwidgets/4.5.3/jqwidgets/jqxlineargauge.js"></script>
</head>
<body>
  <div id="jqxLinearGauge"></>
  <script>
    $(document).ready(function () {
      $('#jqxLinearGauge').jqxLinearGauge({
        orientation: 'vertical',
        ticksMajor: { size: '10%', interval: 10 },
        ticksMinor: { size: '5%', interval: 2.5, style: { 'stroke-width': 1, stroke: '#aaaaaa' } },
        max: 100,
        min: 0,
        value: 75,
        pointer: {
          type: 'arrow',
          size: '5%',
          style: { fill: '#000000' },
          position: '50%'
        },
        ranges: [
          { startValue: 0, endValue: 30, style: { fill: '#4cb848', stroke: '#4cb848' }, startDistance: '0%', endDistance: '25%' },
          { startValue: 30, endValue: 70, style: { fill: '#fad00b', stroke: '#fad00b' }, startDistance: '0%', endDistance: '25%' },
          { startValue: 70, endValue: 100, style: { fill: '#e00000', stroke: '#e00000' }, startDistance: '0%', endDistance: '25%' }
        ],
        rangeOffset: '0%'
      });
    });
  </script>
</body>
</html>

在这个示例中,我们使用jqxLinearGauge组件创建了一个线性仪表盘,并使用rangeOffset属性设置了范围的偏移量为0%。

综上所述,jqxGaugejqxLinearGauge组件都提供了rangeOffset属性,用于设置范围的偏移量。本文详细介绍了rangeOffset属性的使用和示例。

参考

本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:jQWidgets jqxGauge LinearGauge rangeOffset属性 - Python技术站

(0)
上一篇 2023年5月9日
下一篇 2023年5月9日

相关文章

  • 使用jquery动态加载js文件的方法

    对于使用jquery动态加载js文件的方法,下面是详细的讲解攻略。 1. 原本的方式 一般情况下,我们在页面中引入JS文件,会采用如下的方式: <script src="example.js"></script> 然而,这种方式存在一个弊端,就是需要等到JS文件下载完毕后,才能继续渲染页面,从而导致网页加载缓慢的问…

    jquery 2023年5月27日
    00
  • jQuery中hover()和mouseover()方法的区别

    jQuery中hover()和mouseover()方法的区别攻略 在jQuery中,hover()和mouseover()方法都可以用于在鼠标悬停在元素上时执行操作。但是,它们之间有一些区别。以下是详细攻略,含两个示例,演示hover()和mouseover()方法的区别: hover()方法 hover()方法是一个简写方法,它将mouseenter和m…

    jquery 2023年5月9日
    00
  • EasyUI jQuery linkbutton widget

    EasyUI jQuery是一款轻量级、易用的jQuery UI库,其中的linkbutton控件可用于创建链接、按钮等控件。下面是使用该控件的完整攻略: 一、添加EasyUI库 在使用EasyUI jQuery linkbutton控件之前,需要先将它所依赖的EasyUI库添加到页面中。可以从官网http://www.jeasyui.com下载最新版本的E…

    jquery 2023年5月13日
    00
  • jQWidgets jqxGauge LinearGauge值属性

    jQWidgets jqxGauge LinearGauge值属性 jQWidgets是一个基于jQuery的UI组件库,提供了丰富的UI组件和工具,包括表格、表、历、菜单等。jqxGauge和jqxLinearGauge是jQWidgets中的两个组件,用于显示仪盘和线性仪盘。这两个组件都提供了value属性用于设置当前值。 value属性的基本语法 va…

    jquery 2023年5月9日
    00
  • Jquery图形报表插件 jqplot简介及参数详解

    Jquery图形报表插件 jqplot简介及参数详解 简介 jqPlot是一款高度交互性、功能强大的jQuery图表插件。它支持线图、柱状图、饼图、气泡图、散点图等多种图表类型,并且可以使用自定义颜色、字体和样式。此外,它还支持图表的动态更新和多图表显示。使用jqPlot可以极大地简化绘制复杂图表的过程,并且无需复杂的配置即可快速上手。 安装 首先,我们需要…

    jquery 2023年5月28日
    00
  • JQuery isPlainObject()方法

    jQuery.isPlainObject()方法用于检查一个对象是否为纯粹的对象,即通过对象字面量或Object()构造函数创建的对象。本文将详细介绍isPlainObject()方法的语法和用法,并提供两示例说明。 语法 以下是isPlainObject()方法的基本语法: jQuery.isPlainObject(obj) 在这个语法中,obj是要检查的…

    jquery 2023年5月9日
    00
  • jQWidgets jqxToolBar destroyTool()方法

    以下是关于 jQWidgets jqxToolBar 组件中 destroyTool() 方法的详细攻略。 jQWidgets jqxToolBar destroyTool() 方法 jQWidgets jqxToolBar 组件 destroyTool() 方法用于销毁工具栏中的指定工具。该方法接受一个参数,即要销毁的工具的索引或 ID。 语法 $(‘#t…

    jquery 2023年5月11日
    00
  • jQuery Mobile Column-Toggle Table的columnPopupTheme选项

    jQuery Mobile是一个用于开发移动端Web应用的jQuery插件库,其中包括了许多实用的UI组件,包括表格组件。其中一个比较常用的组件是Column-Toggle Table,它可以让用户在移动设备上显示或隐藏表格的列。 在Column-Toggle Table中,有一个名为columnPopupTheme的选项,它可以用来指定在弹出框中显示列选择…

    jquery 2023年5月12日
    00
合作推广
合作推广
分享本页
返回顶部