From e34a156f18ecc7266c78c387f760121434354d1d Mon Sep 17 00:00:00 2001 From: Yash Date: Mon, 24 May 2021 18:27:50 +0530 Subject: [PATCH 1/3] FIX #4573 : added custom fusion chart config to override default message --- app/client/src/mockResponses/WidgetConfigResponse.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/client/src/mockResponses/WidgetConfigResponse.tsx b/app/client/src/mockResponses/WidgetConfigResponse.tsx index 521ce177cf..39a6ca5a91 100644 --- a/app/client/src/mockResponses/WidgetConfigResponse.tsx +++ b/app/client/src/mockResponses/WidgetConfigResponse.tsx @@ -541,6 +541,12 @@ const WidgetConfigResponse: WidgetConfigReducerState = { }, xAxisName: "Last Week", yAxisName: "Total Order Revenue $", + customFusionChartConfig: { + config: { + type: "", + dataSource: {}, + }, + }, }, FORM_BUTTON_WIDGET: { rows: 1 * GRID_DENSITY_MIGRATION_V1, From 9de9b1eb3075202978d034e7c95af7f5a72f83f1 Mon Sep 17 00:00:00 2001 From: Yash Date: Fri, 28 May 2021 14:49:36 +0530 Subject: [PATCH 2/3] FIX #4573 : added sample custom fusion chart config and updated data shape to override default message --- .../mockResponses/WidgetConfigResponse.tsx | 46 +++++++++++++++++-- app/client/src/widgets/ChartWidget/index.tsx | 2 +- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/app/client/src/mockResponses/WidgetConfigResponse.tsx b/app/client/src/mockResponses/WidgetConfigResponse.tsx index 39a6ca5a91..231fd137da 100644 --- a/app/client/src/mockResponses/WidgetConfigResponse.tsx +++ b/app/client/src/mockResponses/WidgetConfigResponse.tsx @@ -542,9 +542,49 @@ const WidgetConfigResponse: WidgetConfigReducerState = { xAxisName: "Last Week", yAxisName: "Total Order Revenue $", customFusionChartConfig: { - config: { - type: "", - dataSource: {}, + type: "column2d", + dataSource: { + chart: { + caption: "Monthly revenue for last year", + subCaption: "Harry's SuperMart", + xAxisName: "Month", + yAxisName: "Revenues (In USD)", + numberPrefix: "$", + theme: "fusion", + }, + data: [ + { + label: "Jan", + value: "420000", + }, + { + label: "Feb", + value: "810000", + }, + { + label: "Mar", + value: "720000", + }, + { + label: "Apr", + value: "550000", + }, + { + label: "May", + value: "910000", + }, + ], + trendlines: [ + { + line: [ + { + startvalue: "700000", + valueOnRight: "1", + displayvalue: "Monthly Target", + }, + ], + }, + ], }, }, }, diff --git a/app/client/src/widgets/ChartWidget/index.tsx b/app/client/src/widgets/ChartWidget/index.tsx index 84432435a9..b06ec6153c 100644 --- a/app/client/src/widgets/ChartWidget/index.tsx +++ b/app/client/src/widgets/ChartWidget/index.tsx @@ -92,7 +92,7 @@ export interface ChartData { export interface ChartWidgetProps extends WidgetProps, WithMeta { chartType: ChartType; chartData: AllChartData; - customFusionChartConfig: { config: CustomFusionChartConfig }; + customFusionChartConfig: CustomFusionChartConfig; xAxisName: string; yAxisName: string; chartName: string; From 8008aefcc7f9b7924b956423b88682bc378086cb Mon Sep 17 00:00:00 2001 From: Yash Date: Thu, 3 Jun 2021 20:50:23 +0530 Subject: [PATCH 3/3] FIX #4573 : custom fusion chart sample data make consistent as chartData property --- .../mockResponses/WidgetConfigResponse.tsx | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/app/client/src/mockResponses/WidgetConfigResponse.tsx b/app/client/src/mockResponses/WidgetConfigResponse.tsx index 231fd137da..2ad873bb0c 100644 --- a/app/client/src/mockResponses/WidgetConfigResponse.tsx +++ b/app/client/src/mockResponses/WidgetConfigResponse.tsx @@ -545,42 +545,48 @@ const WidgetConfigResponse: WidgetConfigReducerState = { type: "column2d", dataSource: { chart: { - caption: "Monthly revenue for last year", - subCaption: "Harry's SuperMart", - xAxisName: "Month", - yAxisName: "Revenues (In USD)", - numberPrefix: "$", + caption: "Last week's revenue", + xAxisName: "Last Week", + yAxisName: "Total Order Revenue $", theme: "fusion", }, data: [ { - label: "Jan", - value: "420000", + label: "Mon", + value: 10000, }, { - label: "Feb", - value: "810000", + label: "Tue", + value: 12000, }, { - label: "Mar", - value: "720000", + label: "Wed", + value: 32000, }, { - label: "Apr", - value: "550000", + label: "Thu", + value: 28000, }, { - label: "May", - value: "910000", + label: "Fri", + value: 14000, + }, + { + label: "Sat", + value: 19000, + }, + { + label: "Sun", + value: 36000, }, ], trendlines: [ { line: [ { - startvalue: "700000", + startvalue: "38000", valueOnRight: "1", - displayvalue: "Monthly Target", + displayvalue: "Weekly Target", }, ], },