bernii/gauge.js

Guage labels as shown here http://bernii.github.io/gauge.js/ does not work out of the box.

Closed this issue · 3 comments

I added this to options

staticLabels: {
font: "10px sans-serif", // Specifies font
labels: [200, 230, 250, 220.1, 260, 300], // Print labels at these values
color: "#111", // Optional: Label text color
fractionDigits: 0 // Optional: Numerical precision. 0=round off.
},

tried changing colors but no luck its showing this only.

download

staticLabels don't work for Donut, only Gauge.

I can't get any labels to show when using the Donut, not even the "main" label shown in the example previews.

Use the setTextField() method on the Dount object and provide the element you want.

For example, in your html you have a

   <div id="preview-textfield"></div>

Pass a ref to that directly after initializing your gauge/donut

// Initialize gauge
gauge.setTextField(document.getElementById("preview-textfield"));