Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const useFetchVisualizations = ({
const cur = queriesRef.current;
const rawQuery = cur![requestParams.tabId][FINAL_QUERY];
fetchVisualizations({
query: `${rawQuery} | stats count() by span(timestamp, '1${interval = interval ? interval: 'm' }')` },
query: `${rawQuery} | stats count() by span(timestamp, 1${interval = interval ? interval: 'm' })` },
'viz',
(res: any) => {
dispatch(renderCountDis({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ export const CountDistribution = ({
countDistribution
}: any) => {

if (!countDistribution || !countDistribution.data) return null;
if (
!countDistribution ||
!countDistribution.data ||
!countDistribution.metadata ||
!countDistribution.metadata.fields
) return null;

const meta = countDistribution.metadata;
const xkey = meta?.xfield?.name;
const ykey = meta?.yfield?.name;
const layout = {
showlegend: true,
margin: {
Expand All @@ -32,24 +34,12 @@ export const CountDistribution = ({
},
height: 220
};
const config = {};
const xaxis = {
autorange: true
};
const yaxis = {
fixedrange: true
};

if (!xkey || !ykey) {
return null;
}

return (
<Bar
visualizations={ countDistribution }
name="Event counts"
layoutConfig={ layout }
config={ config }
/>
);
};