diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.ts index 401e392..d5e67a2 100644 --- a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.ts +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.ts @@ -410,8 +410,8 @@ export class EditnewdashComponent implements OnInit { // If this is a chart, set the chartType property if (chartTypeMap.hasOwnProperty(dashboard.name)) { dashboard.chartType = chartTypeMap[dashboard.name]; - // Change the name to "Unified Chart" for consistency - dashboard.name = "Unified Chart"; + // Keep the original name instead of changing it to "Unified Chart" + // dashboard.name = "Unified Chart"; } // Ensure compact filter configuration properties are properly initialized @@ -454,6 +454,12 @@ export class EditnewdashComponent implements OnInit { if (dashboard.name === 'Unified Chart' && dashboard.chartType && chartNameMap.hasOwnProperty(dashboard.chartType)) { dashboard.name = chartNameMap[dashboard.chartType]; } + // Also handle the case where the chart already has the correct name + else if (dashboard.chartType && chartNameMap.hasOwnProperty(dashboard.chartType) && + dashboard.name === chartNameMap[dashboard.chartType]) { + // The name is already correct, no need to change it + dashboard.component = "Unified Chart"; + } // Ensure compact filter configuration properties are preserved if (dashboard.name === 'Compact Filter') { @@ -521,7 +527,7 @@ export class EditnewdashComponent implements OnInit { y: 0, chartid: maxChartId + 1, component: UnifiedChartComponent, - name: "Unified Chart", + name: "Radar Chart", chartType: 'radar', xAxis: '', yAxis: '', @@ -536,7 +542,7 @@ export class EditnewdashComponent implements OnInit { y: 0, chartid: maxChartId + 1, component: UnifiedChartComponent, - name: "Unified Chart", + name: "Line Chart", chartType: 'line', xAxis: '', yAxis: '', @@ -551,7 +557,7 @@ export class EditnewdashComponent implements OnInit { y: 0, chartid: maxChartId + 1, component: UnifiedChartComponent, - name: "Unified Chart", + name: "Doughnut Chart", chartType: 'doughnut', xAxis: '', yAxis: '', @@ -566,7 +572,7 @@ export class EditnewdashComponent implements OnInit { y: 0, chartid: maxChartId + 1, component: UnifiedChartComponent, - name: "Unified Chart", + name: "Bar Chart", chartType: 'bar', xAxis: '', yAxis: '', @@ -581,7 +587,7 @@ export class EditnewdashComponent implements OnInit { y: 0, chartid: maxChartId + 1, component: UnifiedChartComponent, - name: "Unified Chart", + name: "Pie Chart", chartType: 'pie', xAxis: '', yAxis: '', @@ -596,7 +602,7 @@ export class EditnewdashComponent implements OnInit { y: 0, chartid: maxChartId + 1, component: UnifiedChartComponent, - name: "Unified Chart", + name: "Polar Area Chart", chartType: 'polar', xAxis: '', yAxis: '', @@ -611,7 +617,7 @@ export class EditnewdashComponent implements OnInit { y: 0, chartid: maxChartId + 1, component: UnifiedChartComponent, - name: "Unified Chart", + name: "Bubble Chart", chartType: 'bubble', xAxis: '', yAxis: '', @@ -626,7 +632,7 @@ export class EditnewdashComponent implements OnInit { y: 0, chartid: maxChartId + 1, component: UnifiedChartComponent, - name: "Unified Chart", + name: "Scatter Chart", chartType: 'scatter', xAxis: '', yAxis: '', @@ -641,7 +647,7 @@ export class EditnewdashComponent implements OnInit { y: 0, chartid: maxChartId + 1, component: UnifiedChartComponent, - name: "Unified Chart", + name: "Dynamic Chart", chartType: 'line', // Default to line for dynamic chart xAxis: '', yAxis: '', @@ -656,7 +662,7 @@ export class EditnewdashComponent implements OnInit { y: 0, chartid: maxChartId + 1, component: UnifiedChartComponent, - name: "Unified Chart", + name: "Financial Chart", chartType: 'line', // Default to line for financial chart xAxis: '', yAxis: '', @@ -1137,7 +1143,14 @@ export class EditnewdashComponent implements OnInit { } // For UnifiedChartComponent, pass chart properties with chartType - if (item.name === 'Unified Chart') { + // Check for specific chart names that use UnifiedChartComponent + const unifiedChartNames = [ + 'Radar Chart', 'Line Chart', 'Doughnut Chart', 'Bar Chart', + 'Pie Chart', 'Polar Area Chart', 'Bubble Chart', 'Scatter Chart', + 'Dynamic Chart', 'Financial Chart', 'Unified Chart' + ]; + + if (unifiedChartNames.includes(item.name)) { const unifiedChartInputs = { chartType: item.chartType || 'bar', xAxis: item.xAxis,