diff --git a/packages/main/plugins/Cardinality/Chart.tsx b/packages/main/plugins/Cardinality/Chart.tsx index f7bc2ee0..3e93e866 100644 --- a/packages/main/plugins/Cardinality/Chart.tsx +++ b/packages/main/plugins/Cardinality/Chart.tsx @@ -28,10 +28,8 @@ const CardinalityChart = forwardRef( setWidth(ref?.current?.offsetWidth - 8); } }, [ref?.current]); - const chartRenderer = (isChartGroup, chartData) => { if (chartData && isChartGroup && chart !== "") { - console.log(chartData?.valueTypesMapped[chart]?.names); return ( ); - } else { - return ( + } else if (chartData && !isChartGroup) { + return ( { + const xAxisData = rows?.map((row) => row.name); const valueData = rows?.map((row) => row.value); const diffData = rows?.map((row) => @@ -95,6 +96,9 @@ export const useChartData = (rows: SeriesRowProps[]) => { export const ChartsGroup: React.FC = ({ rows, theme }) => { const chartData = useChartData(rows); + + if(rows.length === 0) return null + return ( {chartData?.valueTypes[0] !== undefined ? ( diff --git a/packages/main/plugins/Cardinality/Configurator.tsx b/packages/main/plugins/Cardinality/Configurator.tsx index 841bf38a..7bfac4f2 100644 --- a/packages/main/plugins/Cardinality/Configurator.tsx +++ b/packages/main/plugins/Cardinality/Configurator.tsx @@ -8,7 +8,7 @@ import useConfigurator from "./useConfigurator"; import CardinalityInput from "./CardinalityInput"; import { ConfigContainerStyles } from "./ConfigContainerStyles"; import { useCardinalityRequest } from "./api/CardinalityRequest"; - +import useCardinalityStore from "./store/CardinalityStore"; type ConfiguratorProps = { theme: any; percent?: number; @@ -45,15 +45,23 @@ const Configurator: React.FC = ({ limit, totalSeries, reset, + date, } = useConfigurator({ setHistoryItem }); //a handler for making a get request to the api const { handleCardinalityRequest } = useCardinalityRequest(true); - + const { setTimeSeriesSelector, setFocusLabel, setLimitEntries } = + useCardinalityStore(); const handleReset = () => { reset(); - handleCardinalityRequest(); + + handleCardinalityRequest({ + match: "", + focusLabel: "", + topN: limit, + date, + }); }; // this feature is not implemented yet @@ -142,7 +150,17 @@ const Configurator: React.FC = ({ Reset