gauge.js icon indicating copy to clipboard operation
gauge.js copied to clipboard

Custom staticLabels

Open amomsi opened this issue 7 years ago • 2 comments

Can you improve staticLabels to have the ability to display custom static labels instead of displaying only values. So for example I can provide: staticLabels: { font: '10px sans-serif', // Specifies font labels: [{ label: 'Foo', value: 10 }, { label: 'Bar', value: 50 }], // Print labels at these values color: '#000000', // Optional: Label text color fractionDigits: 0, // Optional: Numerical precision. 0=round off. }, Then in output I have displayed 'Foo' at value 10 and 'Bar' at value 50. Looking at the code it seems that you thought about that (there is a check if "labels" objects contain a 'label' attribute). Thanks,

amomsi avatar Jun 11 '18 16:06 amomsi

Hi, It will be great if above updates can be provided. My requirement is to show text labels.

i.e. staticLabels: { font: "15px sans-serif", // Specifies font labels: ["Poor", "Fair", "good", "Excellent"], // Print labels at these values color: "#000000" // Optional: Label text color }

but this do not work.

git195 avatar Oct 25 '18 11:10 git195

I have added that functionality: adding text label functionality #228

guze0001 avatar May 08 '20 18:05 guze0001