- {field.value ? field.value.toLocaleString() : getEmptyTagValue()}{' '}
+ {field.value != null ? field.value.toLocaleString() : getEmptyTagValue()}{' '}
{field.description}
diff --git a/x-pack/plugins/siem/public/containers/kpi_hosts/index.gql_query.ts b/x-pack/plugins/siem/public/containers/kpi_hosts/index.gql_query.ts
index 97bcb9d7907c1..cee743d85e373 100644
--- a/x-pack/plugins/siem/public/containers/kpi_hosts/index.gql_query.ts
+++ b/x-pack/plugins/siem/public/containers/kpi_hosts/index.gql_query.ts
@@ -7,7 +7,7 @@
import gql from 'graphql-tag';
export const kpiHostsQuery = gql`
- fragment ChartFields on HistogramData {
+ fragment ChartFields on KpiHostHistogramData {
x: key_as_string
y: count {
value
diff --git a/x-pack/plugins/siem/public/containers/kpi_hosts/index.tsx b/x-pack/plugins/siem/public/containers/kpi_hosts/index.tsx
index 5ee3623015b91..cfcb6a9f9c80c 100644
--- a/x-pack/plugins/siem/public/containers/kpi_hosts/index.tsx
+++ b/x-pack/plugins/siem/public/containers/kpi_hosts/index.tsx
@@ -34,10 +34,12 @@ const formatHistogramData = (
y: { value: number; doc_count: number };
}>
): ChartData[] => {
- return data.map(({ x, y }) => ({
- x,
- y: y.value || y.doc_count,
- }));
+ return data.length > 0
+ ? data.map(({ x, y }) => ({
+ x,
+ y: y.value || y.doc_count,
+ }))
+ : [];
};
export const KpiHostsQuery = pure