mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-12 00:15:50 -06:00
Fix null pointer in chart JS [skip ci]
This commit is contained in:
parent
dd6a6a565f
commit
93aa5b7753
@ -294,31 +294,33 @@ function drawAChart(URI, container, chartType, options, colorData) {
|
||||
lineAtIndex: [],
|
||||
annotation: {},
|
||||
};
|
||||
if (drawVerticalLine !== '') {
|
||||
// draw line using annotation plugin.
|
||||
console.log('Will draw line');
|
||||
chartOpts.options.annotation = {
|
||||
annotations: [{
|
||||
type: 'line',
|
||||
id: 'a-line-1',
|
||||
mode: 'vertical',
|
||||
scaleID: 'x-axis-0',
|
||||
value: drawVerticalLine,
|
||||
borderColor: 'red',
|
||||
borderWidth: 1,
|
||||
label: {
|
||||
backgroundColor: 'rgba(0,0,0,0)',
|
||||
fontFamily: "sans-serif",
|
||||
fontSize: 12,
|
||||
fontColor: "#333",
|
||||
position: "right",
|
||||
xAdjust: -20,
|
||||
yAdjust: -125,
|
||||
enabled: true,
|
||||
content: todayText
|
||||
}
|
||||
}]
|
||||
};
|
||||
if (typeof drawVerticalLine !== 'undefined') {
|
||||
if (drawVerticalLine !== '') {
|
||||
// draw line using annotation plugin.
|
||||
console.log('Will draw line');
|
||||
chartOpts.options.annotation = {
|
||||
annotations: [{
|
||||
type: 'line',
|
||||
id: 'a-line-1',
|
||||
mode: 'vertical',
|
||||
scaleID: 'x-axis-0',
|
||||
value: drawVerticalLine,
|
||||
borderColor: 'red',
|
||||
borderWidth: 1,
|
||||
label: {
|
||||
backgroundColor: 'rgba(0,0,0,0)',
|
||||
fontFamily: "sans-serif",
|
||||
fontSize: 12,
|
||||
fontColor: "#333",
|
||||
position: "right",
|
||||
xAdjust: -20,
|
||||
yAdjust: -125,
|
||||
enabled: true,
|
||||
content: todayText
|
||||
}
|
||||
}]
|
||||
};
|
||||
}
|
||||
}
|
||||
allCharts[container] = new Chart(ctx, chartOpts);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user