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