refactoring
This commit is contained in:
@@ -17,7 +17,7 @@ class UIUtils {
|
||||
return selectElement.options[selectElement.selectedIndex];
|
||||
}
|
||||
|
||||
static labelWithPercentCallback(context) {
|
||||
static getLabelWithPercent(context) {
|
||||
let label = context.dataset.label || '';
|
||||
|
||||
if (label) {
|
||||
@@ -28,4 +28,18 @@ class UIUtils {
|
||||
}
|
||||
return label;
|
||||
}
|
||||
|
||||
static getPercentageScale(label) {
|
||||
return {
|
||||
min: 0,
|
||||
max: 100,
|
||||
title: {
|
||||
display: true,
|
||||
text: label
|
||||
},
|
||||
ticks: {
|
||||
callback: value => value + "%"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user