愛招飛幫助手冊 愛招飛幫助手冊
  • FastERP-1
  • Smart
  • PinToo
  • FastWeb
  • FastERP-2 企業管理系統 (opens new window)
  • 印染業ERP (opens new window)
  • 工廠終端機 (opens new window)
  • TARS
  • MARS
  • TaskRunner
  • Flying
  • FastDesk
  • HiDesk
  • HiNAT
  • FastBPM
  • 設備故障診斷 (opens new window)
  • 設備最佳運轉效益 (opens new window)
  • 企業智能助手SmeGPT (opens new window)
  • 燈號管理 (opens new window)
  • 戰情室 (opens new window)
  • 能源管理 (opens new window)
  • 人車定位 (opens new window)
  • 戰情指揮系統 (opens new window)
  • FastERP-1
  • FastWeb
  • Smart
  • PinToo
  • Flying
  • TARS
  • 通用功能

    • Report
    • Script
    • Echarts
    • Chart
    • DB Install
  • FastERP-1
  • Smart
  • PinToo
  • FastWeb
  • FastERP-2 企業管理系統 (opens new window)
  • 印染業ERP (opens new window)
  • 工廠終端機 (opens new window)
  • TARS
  • MARS
  • TaskRunner
  • Flying
  • FastDesk
  • HiDesk
  • HiNAT
  • FastBPM
  • 設備故障診斷 (opens new window)
  • 設備最佳運轉效益 (opens new window)
  • 企業智能助手SmeGPT (opens new window)
  • 燈號管理 (opens new window)
  • 戰情室 (opens new window)
  • 能源管理 (opens new window)
  • 人車定位 (opens new window)
  • 戰情指揮系統 (opens new window)
  • FastERP-1
  • FastWeb
  • Smart
  • PinToo
  • Flying
  • TARS
  • 通用功能

    • Report
    • Script
    • Echarts
    • Chart
    • DB Install
  • FastWeb幫助主頁
  • 學習手冊

    • 基本入門

    • 功能介紹

    • 控制元件說明

    • 系統工具

    • 系統管理

    • 云服務工具

    • 資料庫工具

    • 專用模板

    • 外部功能

    • 開發流程

      • 開發案例
      • 紡織印染業ERP設計實務
      • 頁面佈局
      • URLFrame與JS的互動
      • 自定控制元件擴充套件

        • 多用途-圓形-指針儀表盤
          • 1. 下載示例
          • 2. 確認參數
          • 3. 修改模板
            • 3.1. 本地化處理
            • 3.2. 標記參數
            • 3.3. 設定參數
            • 3.4. 與資料庫欄位聯動
        • 多用途-半圓形-指針儀表盤1
        • 多用途-半圓形-指針儀表盤2
        • 溫度-垂直-刻度計
        • 方向-圓形-指南針
        • 3D物體實景-自轉瀏覽
        • 3D物體實景-公轉瀏覽
        • 3D平移實景-室內瀏覽
        • 3D平移實景-室外瀏覽
        • 互動-SVG-HMI元件
        • 瀏覽-照片-顯示元件
        • 氣壓-圓形-指針氣壓計1
        • 3D圓柱實景-風景瀏覽
        • 3D球形實景-熱點追蹤
        • 3D球形實景-全景視訊
        • 3D球形全景-汽車內飾
        • 3D球形實景-全景漫遊
      • RestAPI擴充套件

      • IsoBean開發

    • 函式程式

  • 開發手冊

目录

多用途-圓形-指針儀表盤

# FastWeb 多用途-圓形-指針儀表盤

  • 專案地址:https://github.com/Mikhus/canvas-gauges (opens new window)

  圓形指針的儀表盤使用的是Canvas Gauges,這是一套豐富的JS儀表盤元件庫。

  使用的圓形指針儀表盤的樣式如下:

# 1. 下載示例

  點選https://github.com/Mikhus/canvas-gauges/archive/refs/heads/master.zip (opens new window)以下載庫,建議將其中包含的內容解壓縮放置於FastWeb目錄的library/js資料夾中。

# 2. 確認參數

  圓形指針儀表盤的樣式內容如下:

<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Gauge Test</title>
    <link rel="stylesheet" href="library/js/canvas-gauges-master/fonts/fonts.css">
     <script src="library/js/canvas-gauges-master/gauge.min.js"></script>
    <style>body {
        padding: 0;
        margin: 0;
        background: #fff
    }</style>
</head>
<body>

    <canvas id="gauge-ps"></canvas>

    <script>
    var gaugePS = new RadialGauge({
        renderTo: 'gauge-ps',
        width: 400,
        height: 400,
        units: 'PS',
        minValue: 0,
        maxValue: 1000,
        majorTicks: [
            '0',
            '100',
            '200',
            '300',
            '400',
            '500',
            '600',
            '700',
            '800',
            '900',
            '1000'
        ],
        minorTicks: 2,
        ticksAngle: 270,
        startAngle: 45,
        strokeTicks: true,
        highlights  : [
            { from : 457,  to : 880, color : 'rgba(78,   78, 76, 0.5)' },
            { from : 880, to : 1000, color : 'rgba(225, 7, 23, 0.75)' }
        ],
        valueInt: 1,
        valueDec: 0,
        colorPlate: "#fff",
        colorMajorTicks: "#686868",
        colorMinorTicks: "#686868",
        colorTitle: "#000",
        colorUnits: "#000",
        colorNumbers: "#686868",
        valueBox: true,
        colorValueText: "#000",
        colorValueBoxRect: "#fff",
        colorValueBoxRectEnd: "#fff",
        colorValueBoxBackground: "#fff",
        colorValueBoxShadow: false,
        colorValueTextShadow: false,
        colorNeedleShadowUp: true,
        colorNeedleShadowDown: false,
        colorNeedle: "rgba(200, 50, 50, .75)",
        colorNeedleEnd: "rgba(200, 50, 50, .75)",
        colorNeedleCircleOuter: "rgba(200, 200, 200, 1)",
        colorNeedleCircleOuterEnd: "rgba(200, 200, 200, 1)",
        borderShadowWidth: 0,
        borders: true,
        borderInnerWidth: 0,
        borderMiddleWidth: 0,
        borderOuterWidth: 5,
        colorBorderOuter: "#fafafa",
        colorBorderOuterEnd: "#cdcdcd",
        needleType: "arrow",
        needleWidth: 2,
        needleCircleSize: 7,
        needleCircleOuter: true,
        needleCircleInner: false,
        animationDuration: 1500,
        animationRule: "dequint",
        fontNumbers: "Verdana",
        fontTitle: "Verdana",
        fontUnits: "Verdana",
        fontValue: "Led",
        fontValueStyle: 'italic',
        fontNumbersSize: 20,
        fontNumbersStyle: 'italic',
        fontNumbersWeight: 'bold',
        fontTitleSize: 24,
        fontUnitsSize: 22,
        fontValueSize: 50,
        animatedValue: true
    });
    gaugePS.draw();
    gaugePS.value = "510";
    </script>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

  從上述的語言中,可以找到一個名為data-value的參數,其中得到的值就是半圓形儀表盤指針指向的數值。此處可為其設定參數值為param_value。

# 3. 修改模板

# 3.1. 本地化處理

  上述模板已經將所需的檔案本地化處理,不需要額外進行本地化的相關設定。

# 3.2. 標記參數

  將上述的value處后的值使用param_value來代替,替換后的內容如下:

<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Gauge Test</title>
    <link rel="stylesheet" href="library/js/canvas-gauges-master/fonts/fonts.css">
     <script src="library/js/canvas-gauges-master/gauge.min.js"></script>
    <style>body {
        padding: 0;
        margin: 0;
        background: #fff
    }</style>
</head>
<body>

    <canvas id="gauge-ps"></canvas>

    <script>
    var gaugePS = new RadialGauge({
        renderTo: 'gauge-ps',
        width: 400,
        height: 400,
        units: 'PS',
        minValue: 0,
        maxValue: 1000,
        majorTicks: [
            '0',
            '100',
            '200',
            '300',
            '400',
            '500',
            '600',
            '700',
            '800',
            '900',
            '1000'
        ],
        minorTicks: 2,
        ticksAngle: 270,
        startAngle: 45,
        strokeTicks: true,
        highlights  : [
            { from : 457,  to : 880, color : 'rgba(78,   78, 76, 0.5)' },
            { from : 880, to : 1000, color : 'rgba(225, 7, 23, 0.75)' }
        ],
        valueInt: 1,
        valueDec: 0,
        colorPlate: "#fff",
        colorMajorTicks: "#686868",
        colorMinorTicks: "#686868",
        colorTitle: "#000",
        colorUnits: "#000",
        colorNumbers: "#686868",
        valueBox: true,
        colorValueText: "#000",
        colorValueBoxRect: "#fff",
        colorValueBoxRectEnd: "#fff",
        colorValueBoxBackground: "#fff",
        colorValueBoxShadow: false,
        colorValueTextShadow: false,
        colorNeedleShadowUp: true,
        colorNeedleShadowDown: false,
        colorNeedle: "rgba(200, 50, 50, .75)",
        colorNeedleEnd: "rgba(200, 50, 50, .75)",
        colorNeedleCircleOuter: "rgba(200, 200, 200, 1)",
        colorNeedleCircleOuterEnd: "rgba(200, 200, 200, 1)",
        borderShadowWidth: 0,
        borders: true,
        borderInnerWidth: 0,
        borderMiddleWidth: 0,
        borderOuterWidth: 5,
        colorBorderOuter: "#fafafa",
        colorBorderOuterEnd: "#cdcdcd",
        needleType: "arrow",
        needleWidth: 2,
        needleCircleSize: 7,
        needleCircleOuter: true,
        needleCircleInner: false,
        animationDuration: 1500,
        animationRule: "dequint",
        fontNumbers: "Verdana",
        fontTitle: "Verdana",
        fontUnits: "Verdana",
        fontValue: "Led",
        fontValueStyle: 'italic',
        fontNumbersSize: 20,
        fontNumbersStyle: 'italic',
        fontNumbersWeight: 'bold',
        fontTitleSize: 24,
        fontUnitsSize: 22,
        fontValueSize: 50,
        animatedValue: true
    });
    gaugePS.draw();
    gaugePS.value = "param_value";
    </script>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

  上述模板內容已設定完成,可在JQuery元件的模板中匯入上述內容。

# 3.3. 設定參數

  在參數界面中,設定上述參數,分別為其設定預設值:

# 3.4. 與資料庫欄位聯動

  可以設定數據來源於資料庫欄位,可設定不使用。

URLFrame與JS的互動
多用途-半圓形-指針儀表盤1

← URLFrame與JS的互動 多用途-半圓形-指針儀表盤1→

Copyright © 2021-2025 愛招飛IsoFace | ALL Rights Reserved
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式