Browse Source

next upd

main
gsd 10 hours ago
parent
commit
9ad8284716
  1. 7
      chartGenerator.js
  2. 8
      utils.js

7
chartGenerator.js

@ -72,7 +72,7 @@ const customLabelsPlugin = {
ctx.save();
labels.forEach((label, i) => {
const p = r.getPointPosition(i, r.drawingArea + 50);
const p = r.getPointPosition(i, r.drawingArea + 40);
const align = getTextAlignByPoint(p, r);
const lines = Array.isArray(label) ? label : [label];
@ -160,7 +160,7 @@ function generateChartData(d) {
responsive: false,
maintainAspectRatio: false,
layout: {
padding: 110
padding: 130
},
plugins: {
legend: {
@ -217,4 +217,5 @@ function test() {
out.on('finish', () => console.log('The chart image was saved.'));
}
//test()
if (process.env.TEST)
test()

8
utils.js

@ -29,14 +29,14 @@ function formatSeconds(totalSeconds) {
const lastTwoDigits = days % 100;
if (lastTwoDigits >= 11 && lastTwoDigits <= 14) {
dayWord = ней";
dayWord = "д";
} else {
switch (lastDigit) {
case 1: dayWord = ень"; break;
case 1: dayWord = "д"; break;
case 2:
case 3:
case 4: dayWord = ня"; break;
default: dayWord = ней";
case 4: dayWord = "д"; break;
default: dayWord = "д";
}
}

Loading…
Cancel
Save