diff --git a/src/renderer/components/chart/bar-chart.tsx b/src/renderer/components/chart/bar-chart.tsx index 19ef031ba6..5c3e134664 100644 --- a/src/renderer/components/chart/bar-chart.tsx +++ b/src/renderer/components/chart/bar-chart.tsx @@ -50,6 +50,10 @@ export class BarChart extends React.Component { }) }; + if (chartData.datasets.length == 0) { + return ; + } + const formatTimeLabels = (timestamp: string, index: number) => { const label = moment(parseInt(timestamp)).format("HH:mm"); const offset = " "; @@ -143,10 +147,6 @@ export class BarChart extends React.Component { }; const options = merge(barOptions, customOptions); - if (chartData.datasets.length == 0) { - return ; - } - return (