Skip to content

Commit

Permalink
Fix budget-controlling graph, fixes #62566
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagemaru committed Mar 11, 2024
1 parent bae1402 commit 31072a9
Showing 1 changed file with 44 additions and 41 deletions.
85 changes: 44 additions & 41 deletions app/assets/javascripts/order_controlling.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -59,47 +59,50 @@ app.initOrderControllingChart = (labels, datasets, budget, currency, currentLabe
label: (item, data) ->
data.datasets[item.datasetIndex].label + ': ' + formatCurrency(item.yLabel)
}
}
annotation: {
annotations: [{
type: 'line',
mode: 'vertical',
scaleID: 'x-axis-0',
value: currentLabel,
borderColor: todayColor,
borderWidth: 2,
label: {
enabled: true,
content: 'heute',
position: 'top'
yAdjust: 10,
xPadding: 2,
yPadding: 3,
backgroundColor: '#ffffff'
fontFamily: Chart.defaults.font.family,
fontSize: Chart.defaults.font.size,
fontStyle: 'normal',
fontColor: todayColor
}
}, {
type: 'line',
mode: 'horizontal',
scaleID: 'y-axis-0',
value: budget,
borderColor: budgetColor,
borderWidth: 2,
label: {
enabled: true,
content: 'Budget ' + formatCurrency(budget),
position: 'left',
yAdjust: 11,
backgroundColor: 'transparent',
fontFamily: Chart.defaults.font.family,
fontSize: Chart.defaults.font.size,
fontStyle: 'normal',
fontColor: budgetColor
}
}]
},
plugins: {
annotation: {
annotations: [{
type: 'line',
scaleID: 'x',
value: currentLabel,
borderColor: todayColor,
borderWidth: 2,
label: {
display: true,
content: 'heute',
position: 'start',
yAdjust: 10,
padding: {x: 2, y: 3},
backgroundColor: '#ffffff',
color: todayColor,
font: {
family: Chart.defaults.font.family,
size: Chart.defaults.font.size,
style: 'normal',
}
}
}, {
type: 'line',
scaleID: 'y',
value: budget,
borderColor: budgetColor,
borderWidth: 2,
label: {
display: true,
content: 'Budget ' + formatCurrency(budget),
position: 'start',
yAdjust: 11,
backgroundColor: 'transparent',
color: budgetColor,
font: {
family: Chart.defaults.font.family,
size: Chart.defaults.font.size,
style: 'normal',
}
}
}]
}
}
},
})

0 comments on commit 31072a9

Please sign in to comment.