Render empty bar and heatmap charts.

This commit is contained in:
Orne Brocaar 2022-06-29 09:14:51 +01:00
parent 462ff3665d
commit a04d47833f
3 changed files with 3 additions and 15 deletions

View File

@ -1,6 +1,6 @@
import React, { Component } from "react";
import { Card, Empty } from "antd";
import { Card } from "antd";
import { TimeUnit } from "chart.js";
import { Bar } from "react-chartjs-2";
@ -15,10 +15,6 @@ interface IProps {
class MetricBar extends Component<IProps> {
render() {
if (this.props.metric.getTimestampsList().length === 0 || this.props.metric.getDatasetsList().length === 0) {
return <Empty />;
}
let unit: TimeUnit = "hour";
if (this.props.aggregation === Aggregation.DAY) {
unit = "day";

View File

@ -1,6 +1,6 @@
import React, { Component } from "react";
import { Card, Empty } from "antd";
import { Card } from "antd";
import { TimeUnit } from "chart.js";
import { Line } from "react-chartjs-2";
@ -16,10 +16,6 @@ interface IProps {
class MetricChart extends Component<IProps> {
render() {
if (this.props.metric.getTimestampsList().length === 0 || this.props.metric.getDatasetsList().length === 0) {
return <Empty />;
}
let unit: TimeUnit = "hour";
if (this.props.aggregation === Aggregation.DAY) {
unit = "day";

View File

@ -1,6 +1,6 @@
import React, { Component } from "react";
import { Card, Empty } from "antd";
import { Card } from "antd";
import { color } from "chart.js/helpers";
import { TimeUnit } from "chart.js";
@ -18,10 +18,6 @@ interface IProps {
class MetricHeatmap extends Component<IProps> {
render() {
if (this.props.metric.getTimestampsList().length === 0 || this.props.metric.getDatasetsList().length === 0) {
return <Empty />;
}
let unit: TimeUnit = "hour";
if (this.props.aggregation === Aggregation.DAY) {
unit = "day";