Update editnewdash.component.ts
This commit is contained in:
@@ -546,7 +546,7 @@ export class EditnewdashComponent implements OnInit {
|
|||||||
//this._ds.updateDashboard(this.dashboardId, parsed).subscribe();
|
//this._ds.updateDashboard(this.dashboardId, parsed).subscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
onDrop(ev) {
|
onDrop = (ev) => {
|
||||||
console.log("on drop event ", ev);
|
console.log("on drop event ", ev);
|
||||||
const componentType = ev.dataTransfer.getData("widgetIdentifier");
|
const componentType = ev.dataTransfer.getData("widgetIdentifier");
|
||||||
// Safely calculate maxChartId, handling cases where chartid might be NaN or missing
|
// Safely calculate maxChartId, handling cases where chartid might be NaN or missing
|
||||||
@@ -2069,7 +2069,7 @@ export class EditnewdashComponent implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
// Add method to create a dynamic chart with configuration from database
|
// Add method to create a dynamic chart with configuration from database
|
||||||
createDynamicChart(chartTypeName: string, maxChartId: number) {
|
createDynamicChart = (chartTypeName: string, maxChartId: number) => {
|
||||||
console.log(`Creating dynamic chart of type: ${chartTypeName}`);
|
console.log(`Creating dynamic chart of type: ${chartTypeName}`);
|
||||||
|
|
||||||
// First, get the chart type by name
|
// First, get the chart type by name
|
||||||
@@ -2131,7 +2131,7 @@ export class EditnewdashComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fallback method to create default chart configuration
|
// Fallback method to create default chart configuration
|
||||||
createDefaultChart(chartTypeName: string, chartDisplayName: string) {
|
createDefaultChart = (chartTypeName: string, chartDisplayName: string) => {
|
||||||
console.log(`Creating default chart for ${chartTypeName}`);
|
console.log(`Creating default chart for ${chartTypeName}`);
|
||||||
|
|
||||||
// Map chart type names to chart types - making it fully dynamic
|
// Map chart type names to chart types - making it fully dynamic
|
||||||
@@ -2190,7 +2190,7 @@ export class EditnewdashComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Helper method to get display name for chart type - making it fully dynamic
|
// Helper method to get display name for chart type - making it fully dynamic
|
||||||
getChartDisplayName(chartTypeName: string): string {
|
getChartDisplayName = (chartTypeName: string): string => {
|
||||||
const displayNameMap = {
|
const displayNameMap = {
|
||||||
'bar': 'Bar Chart',
|
'bar': 'Bar Chart',
|
||||||
'line': 'Line Chart',
|
'line': 'Line Chart',
|
||||||
|
|||||||
Reference in New Issue
Block a user