使用justGage.js在量规图表上添加值

时间:2019-10-03 12:59:42

标签: javascript html css charts justgage

有人知道如何在量表上添加一个值吗?我正在使用justgage.js

目前我有这样的情况:

enter image description here

我想要实现的是这样的东西?

enter image description here

我的代码是这样的:

  document.addEventListener("DOMContentLoaded", function (event) {
                    var jg1;

                    var defs1 = {
                        label: "Average",
                        value: 2.5,
                        min: 0,
                        max: 5,
                        valueText: 2,
                        labelMinFontSize: 9,
                        gaugeColor: "#edebeb",
                        decimals: 0.0,
                        gaugeWidthScale: 0.8,
                        pointer: true,
                        formatNumber: true,
                        startAnimationTime: 2000,
                        levelColors: ["#0066cc", "#0066cc", "#0066cc"],

                        pointerOptions: {
                            toplength: -15,
                            bottomlength: 10,
                            bottomwidth: 12,
                            color: '#8e8e93',
                            stroke: '#ffffff',
                            stroke_width: 3,
                            stroke_linecap: 'round'
                        },
                        counter: true,
                        relativeGaugeSize: true
                    }

                    jg1 = new JustGage({
                        id: "jg1",
                        defaults: defs1
                    });

                });

0 个答案:

没有答案