Skip to content

Commit 6d6fddb

Browse files
committed
Fix chartjs
1 parent 5d3b9d7 commit 6d6fddb

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# Ignore local config files
1212
/.envrc
13+
/.env*
1314
.idea/
1415
*.iml
1516
/.byebug_history

app/assets/javascripts/order_controlling.js.coffee

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ app.initOrderControllingChart = (labels, datasets, budget, currency, currentLabe
1111
canvas = document.getElementById('order_controlling_chart')
1212
ctx = canvas.getContext('2d')
1313

14-
Chart.defaults.global.defaultFontFamily = 'Roboto, Helvetica, Arial, sans-serif'
15-
Chart.defaults.global.defaultFontColor = '#444444'
16-
Chart.defaults.global.defaultFontSize = 14
14+
Chart.defaults.font.family = 'Roboto, Helvetica, Arial, sans-serif'
15+
Chart.defaults.color = '#444444'
16+
Chart.defaults.font.size = 14
1717

1818
budgetColor = '#B44B5B'
1919
todayColor = '#f0ad4e'
@@ -31,13 +31,13 @@ app.initOrderControllingChart = (labels, datasets, budget, currency, currentLabe
3131
options: {
3232
responsive: false,
3333
scales: {
34-
xAxes: [{
34+
x: {
3535
stacked: true,
3636
gridLines: {
3737
color: gridColor
3838
}
39-
}],
40-
yAxes: [{
39+
},
40+
y: {
4141
stacked: true,
4242
ticks: {
4343
beginAtZero: true,
@@ -47,11 +47,11 @@ app.initOrderControllingChart = (labels, datasets, budget, currency, currentLabe
4747
color: gridLightColor,
4848
zeroLineColor: gridColor
4949
},
50-
}],
50+
},
5151
},
5252
legend: {
5353
labels: {
54-
boxWidth: Chart.defaults.global.defaultFontSize
54+
boxWidth: Chart.defaults.font.size
5555
}
5656
},
5757
tooltips: {
@@ -76,8 +76,8 @@ app.initOrderControllingChart = (labels, datasets, budget, currency, currentLabe
7676
xPadding: 2,
7777
yPadding: 3,
7878
backgroundColor: '#ffffff'
79-
fontFamily: Chart.defaults.global.defaultFontFamily,
80-
fontSize: Chart.defaults.global.defaultFontSize,
79+
fontFamily: Chart.defaults.font.family,
80+
fontSize: Chart.defaults.font.size,
8181
fontStyle: 'normal',
8282
fontColor: todayColor
8383
}
@@ -94,8 +94,8 @@ app.initOrderControllingChart = (labels, datasets, budget, currency, currentLabe
9494
position: 'left',
9595
yAdjust: 11,
9696
backgroundColor: 'transparent',
97-
fontFamily: Chart.defaults.global.defaultFontFamily,
98-
fontSize: Chart.defaults.global.defaultFontSize,
97+
fontFamily: Chart.defaults.font.family,
98+
fontSize: Chart.defaults.font.size,
9999
fontStyle: 'normal',
100100
fontColor: budgetColor
101101
}

0 commit comments

Comments
 (0)