Open kkliuxu opened 7 years ago
Agree that label formatting is not that great.... The quickest way to improve it is to make the modifications you need yourself, though. Feel free to submit a pull request.
What we could do is to open up for a user-given value formatter function. That means that you as a user can override the standard value formatting function inside gauge.js like this:
function myValueFormat(value, digits) {
return value.toFixed(digits) + "%";
}
// Provide access to it alongside the other options
var opts = {
// ...
valueFormat: myValueFormat
};
var target = document.getElementById('foo'); // your canvas element
var gauge = new Gauge(target).setOptions(opts);
Something like that, maybe?
I'm in need of custom label strings too.
I also need custom labels based on the value. The proposed solution by kplindegaard looks promising! Any chance of integrating this?
This is pretty cool Gauge Library. But I find that, if I want to customized or so call format the label. I can not. i want to show % near the label but I only can show the value and can not format it. Could you improve it in the next version? Thanks.
This is pretty cool Gauge Library., But I find that, if I want to customized or so call format the label. I can not. this is how I want to showing the label
however, I only can show the value and can not format it.
Could you improve it in the next version? Thanks.