Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

chore: refactor

DarkPhoenix2704f10bb5655a2c
diff --git a/packages/nocodb-sdk/src/lib/dashboard/widgetUtils.ts b/packages/nocodb-sdk/src/lib/dashboard/widgetUtils.ts
index 9ca424432a..44438869c1 100644
--- a/packages/nocodb-sdk/src/lib/dashboard/widgetUtils.ts
+++ b/packages/nocodb-sdk/src/lib/dashboard/widgetUtils.ts
@@ -179,14 +179,14 @@ const getDefaultChartConfig = (
// Fallback: first column
return (
- columns.filter(
+ columns.find(
(col) =>
- isSystemColumn(col) &&
- isButton(col) &&
- isLookup(col) &&
- isQrCode(col) &&
- isBarcode(col)
- )[0]?.id || ''
+ !isSystemColumn(col) &&
+ !isButton(col) &&
+ !isLookup(col) &&
+ !isQrCode(col) &&
+ !isBarcode(col)
+ )?.id || null
);
};
@@ -251,7 +251,7 @@ const getDefaultChartConfig = (
case ChartTypes.LINE:
return {
...baseConfig,
- chartType: ChartTypes.BAR,
+ chartType: chartType,
appearance: {
showCountInLegend: true,
legendPosition: 'top',