Closed OmkarFatale closed 4 years ago
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"));
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.