Skip to content

Commit c6a2929

Browse files
committed
update chartTypes
1 parent e995dea commit c6a2929

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

app/[locale]/dashboard/[entityType]/[entitySlug]/charts/[chartID]/components/ChartGenVizPreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ const ChartGenVizPreview = ({ params }: { params: any }) => {
241241
name: '',
242242
schema: [],
243243
},
244-
type: ChartTypes.BarVertical,
244+
type: ChartTypes.Bar,
245245
chart: {},
246246
});
247247

app/[locale]/dashboard/[entityType]/[entitySlug]/charts/components/ChartForm.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,9 @@ const ChartForm: React.FC<ChartFormProps> = ({
2424
const isAssamChart =
2525
chartData.type === ChartTypes.AssamDistrict ||
2626
chartData.type === ChartTypes.AssamRc;
27-
const isGroupedChart =
28-
chartData.type === ChartTypes.GroupedBarVertical ||
29-
chartData.type === ChartTypes.GroupedBarHorizontal ||
30-
chartData.type === ChartTypes.Multiline;
3127

3228
const isBarOrLineChart =
33-
chartData.type === ChartTypes.BarVertical ||
34-
chartData.type === ChartTypes.BarHorizontal ||
35-
chartData.type === ChartTypes.Line;
29+
chartData.type === ChartTypes.Bar || chartData.type === ChartTypes.Line;
3630

3731
useEffect(() => {
3832
if (
@@ -278,7 +272,7 @@ const ChartForm: React.FC<ChartFormProps> = ({
278272
/>
279273
</div>
280274

281-
{(isBarOrLineChart || isGroupedChart) && (
275+
{isBarOrLineChart && (
282276
<div className="flex flex-row flex-wrap justify-between gap-4">
283277
<div className="flex flex-col gap-4 ">
284278
{chartData?.options?.yAxisColumn?.map((column, index) => (
@@ -332,15 +326,15 @@ const ChartForm: React.FC<ChartFormProps> = ({
332326
onBlur={() => handleSave(chartData)}
333327
/>
334328
</div>
335-
{isGroupedChart && index > 0 && (
329+
{index > 0 && (
336330
<Button onClick={() => removeYAxisColumn(index)}>
337331
Remove
338332
</Button>
339333
)}
340334
</div>
341335
))}
342336
</div>
343-
{isGroupedChart && (
337+
{isBarOrLineChart && (
344338
<Button className="mt-4 h-fit w-fit" onClick={addYAxisColumn}>
345339
Add Y-axis Column
346340
</Button>

app/[locale]/dashboard/[entityType]/[entitySlug]/charts/components/ChartsVisualize.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ const ChartsVisualize: React.FC<VisualizationProps> = ({
182182
timeColumn: '',
183183
},
184184
resource: '',
185-
type: ChartTypes.BarVertical,
185+
type: ChartTypes.Bar,
186186
chart: {},
187187
});
188188

@@ -278,8 +278,8 @@ const ChartsVisualize: React.FC<VisualizationProps> = ({
278278
timeColumn: '',
279279
yAxisColumn: [],
280280
};
281-
case ChartTypes.BarVertical:
282-
case ChartTypes.BarHorizontal:
281+
case ChartTypes.Bar:
282+
case ChartTypes.Line:
283283
return {
284284
...baseOptions,
285285
yAxisColumn: [{ fieldName: '', label: '', color: '#000000' }],

0 commit comments

Comments
 (0)