xiaomitangtang / t-digital-gauge Goto Github PK
View Code? Open in Web Editor NEWcanvas digital gauge 一个数字仪表盘
canvas digital gauge 一个数字仪表盘
1、gaugeType":"donut",decimals设置无效,始终显示2位小数
2、值为0时,显示 -0.00
谢谢更新。
发现两个小问题,
1、在用DigitalGauge时,必须要import { Knob, Swtich, DigitalGauge } from "t-digital-gauge2";而不能
import { DigitalGauge } from "t-digital-gauge2";
2、相比第一版的用法改动较大,比如去掉了使用option设置参数
1、我的option如下:
widgetOption: {
"gaugeType": "donut",
"minValue": "0",
"maxValue": "100",
"value": 10,
"showValue": true,
"valueFont":{
"family": "Roboto", "style": "normal", "weight": "500", "size": 18, "color": "#ffffff" }
}
this.gauge = new DigitalGauge(document.getElementById(this.elId), widgetOption);
此时中间的value值不会显示。
必须要单独赋值:
this.gauge.value = Math.random() * 100
//
另外浏览器报js错误如下:
Uncaught ReferenceError: str is not defined
at e.default.set time [as time] (digitalgauge.js?ba59:1)
at e.default.set value [as value] (digitalgauge.js?ba59:1)
at eval (digitalgauge.js?ba59:1)
at Array.forEach ()
2、在使用控件时,必须要import DigitalGauge from "t-digital-gauge2/dist/digitalgauge";
而不能 import DigitalGauge from "t-digital-gauge2";
否则会报错:
Uncaught TypeError: t_digital_gauge2__WEBPACK_IMPORTED_MODULE_1___default.a is not a constructor
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.