Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Survey Answer Data Chart #249

Merged
merged 45 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
546617a
Prototype SurveyDataChart
ajmenca Mar 1, 2024
f97073e
Fix css to make tooltip legible
ajmenca Mar 1, 2024
e579df7
Support multiple stroke colors for lines
ajmenca Mar 1, 2024
ada59a7
Fix stories copy/paste
ajmenca Mar 1, 2024
eb54f23
Basic bar chart support
ajmenca Mar 1, 2024
ca285eb
Area chart with multiple lines prototype
ajmenca Mar 1, 2024
a17b200
Simplify + extra color support
ajmenca Mar 7, 2024
d213057
Minor clean ups
ajmenca Mar 8, 2024
2630f00
Merge branch 'main' into survey-answer-month-chart
ajmenca Apr 25, 2024
85e7d10
Merge flog fixes
ajmenca Apr 25, 2024
1466b8d
Cleanups of unused bits and errors
ajmenca Apr 25, 2024
d80080d
Fix/update exports
ajmenca Apr 25, 2024
74b09bd
Fix gradient case key
ajmenca Apr 26, 2024
916e5a3
Review Updates
ajmenca May 1, 2024
ff5cf88
Add a six month option to the date range navigator, implement on time…
ajmenca May 2, 2024
58b1ff5
Change Time Series Chart to use time scale
ajmenca May 2, 2024
ecb57a8
Put time sorting back into place so recharts animation works properly
ajmenca May 2, 2024
8553b5a
UI Fixes
ajmenca May 2, 2024
62d5d6d
Cleanliness tweaks
ajmenca May 2, 2024
e8961d7
Improve Stories
ajmenca May 2, 2024
ce58283
Fix date presentation
ajmenca May 2, 2024
b523b25
Fixes; backwards compatibility features
ajmenca May 3, 2024
2d642f7
Don't do data modification in place
ajmenca May 3, 2024
24a9a35
Allow intraday view for TimeSeries
ajmenca May 3, 2024
44dcecf
Rename day to timestamp to accomodate intraday points
ajmenca May 3, 2024
b7af74c
fix day -> timestamp references
ajmenca May 3, 2024
c894ddd
More day -> timestamp references
ajmenca May 3, 2024
f5e7692
Rename dataGap
ajmenca May 7, 2024
d7e60b1
Use useInitializeView
ajmenca May 7, 2024
86c6ff9
Remove redundant day indicator, and "isToday" styling on intraday
ajmenca May 7, 2024
17991ab
Pull 6 month view out of Daily Data Chart
ajmenca May 7, 2024
481fdab
Merge branch 'main' into survey-answer-month-chart
ajmenca May 13, 2024
dcd5fb6
Rename SixMonth to 6Month
ajmenca May 17, 2024
320f783
Clarify defaults; fix TS warning
ajmenca May 17, 2024
4fca357
Rename SurveyDataChart to SurveyAnswerChart
ajmenca May 17, 2024
d516709
Better defaults for 6Month timespan
ajmenca May 17, 2024
22d87c7
Renamed css classes moved to a new widget.
ajmenca May 17, 2024
60d7cd0
Demonstrate FFWEL with data gap
ajmenca May 17, 2024
e4ec705
Fix SurveyAnswerChart always passing at least an empty array to TimeS…
ajmenca May 17, 2024
40161cf
Duplicate function refactoring
ajmenca May 17, 2024
5ee53a2
Adjust tooltip formatting
ajmenca May 17, 2024
ba9ad29
Predictable random data generation
ajmenca May 17, 2024
300a1e8
Adjust multiseries chart properties
ajmenca May 30, 2024
e1875e4
Build fixes, plus accepting a few coderabbit suggestions
ajmenca Jun 4, 2024
04f6bba
Quiet a few more code rabbit things
ajmenca Jun 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from "react";
import { DailyDataType } from "../../../helpers";
import { DailyDataQueryResult, DailyDataType, getDayKey, queryPreviewDailyData } from "../../../helpers";
import { Card, Layout } from "../../presentational";
import DailyDataChart, { DailyDataChartProps } from "./DailyDataChart";
import { add } from "date-fns";

export default { title: "Container/DailyDataChart", component: DailyDataChart, parameters: { layout: 'fullscreen' } };
let render = (args: DailyDataChartProps) => <Layout colorScheme="auto"><Card><DailyDataChart {...args} /></Card></Layout>
Expand All @@ -22,6 +23,34 @@ export const stepsLineChart = {
render: render
};

export const stepsWithGapLineChart = {
args: {
title: "Steps",
options: {
domainMin: 0,
lineColor: "red"
},
intervalType: "Week",
weekStartsOn: "6DaysAgo",
dailyDataType: DailyDataType.Steps,
valueFormatter: (value: number) => Number(value.toFixed(0)).toLocaleString(),
chartType: "Line",
previewDataProvider: (start: Date, end: Date) => {
let data: DailyDataQueryResult = {};
let currentDate = new Date(start);
while (currentDate < end) {
if(currentDate.getDate() % 3 !== 0) {
let dayKey = getDayKey(currentDate);
data[dayKey] = Math.random() * 10000 + 3000;
}
currentDate = add(currentDate, { days: 1 });
}
return Promise.resolve(data);
}
ajmenca marked this conversation as resolved.
Show resolved Hide resolved
},
render: render
};
Comment on lines +26 to +52
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a more deterministic approach to generate random data for the stepsWithGapLineChart story to ensure consistent results across re-renders.

- previewDataProvider: (start: Date, end: Date) => {
-     let data: DailyDataQueryResult = {};
-     let currentDate = new Date(start);
-     while (currentDate < end) {
-         if(currentDate.getDate() % 3 !== 0) {
-             let dayKey = getDayKey(currentDate);
-             data[dayKey] = Math.random() * 10000 + 3000;
-         }
-         currentDate = add(currentDate, { days: 1 });
-     }
-     return Promise.resolve(data);
- }
+ previewDataProvider: (start: Date, end: Date) => {
+     let data: DailyDataQueryResult = {};
+     let currentDate = new Date(start);
+     while (currentDate < end) {
+         if(currentDate.getDate() % 3 !== 0) {
+             let dayKey = getDayKey(currentDate);
+             data[dayKey] = (currentDate.getDate() * 1000) % 10000 + 3000;
+         }
+         currentDate = add(currentDate, { days: 1 });
+     }
+     return Promise.resolve(data);
+ }

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
export const stepsWithGapLineChart = {
args: {
title: "Steps",
options: {
domainMin: 0,
lineColor: "red"
},
intervalType: "Week",
weekStartsOn: "6DaysAgo",
dailyDataType: DailyDataType.Steps,
valueFormatter: (value: number) => Number(value.toFixed(0)).toLocaleString(),
chartType: "Line",
previewDataProvider: (start: Date, end: Date) => {
let data: DailyDataQueryResult = {};
let currentDate = new Date(start);
while (currentDate < end) {
if(currentDate.getDate() % 3 !== 0) {
let dayKey = getDayKey(currentDate);
data[dayKey] = Math.random() * 10000 + 3000;
}
currentDate = add(currentDate, { days: 1 });
}
return Promise.resolve(data);
}
},
render: render
};
export const stepsWithGapLineChart = {
args: {
title: "Steps",
options: {
domainMin: 0,
lineColor: "red"
},
intervalType: "Week",
weekStartsOn: "6DaysAgo",
dailyDataType: DailyDataType.Steps,
valueFormatter: (value: number) => Number(value.toFixed(0)).toLocaleString(),
chartType: "Line",
previewDataProvider: (start: Date, end: Date) => {
let data: DailyDataQueryResult = {};
let currentDate = new Date(start);
while (currentDate < end) {
if(currentDate.getDate() % 3 !== 0) {
let dayKey = getDayKey(currentDate);
data[dayKey] = (currentDate.getDate() * 1000) % 10000 + 3000;
}
currentDate = add(currentDate, { days: 1 });
}
return Promise.resolve(data);
}
},
render: render
};


export const stepsBarChart = {
args: {
title: "Steps",
Expand Down
291 changes: 87 additions & 204 deletions src/components/container/DailyDataChart/DailyDataChart.tsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/components/container/DailyDataChart/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default, LineChartOptions, BarChartOptions, AreaChartOptions, BarChartThreshold } from "./DailyDataChart";
export { default } from "./DailyDataChart";
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
import React from "react";
import { Card, DateRangeCoordinator, Layout } from "../../presentational";
import SurveyAnswerChart, { SurveyAnswerChartProps } from "./SurveyAnswerChart";
import { SurveyAnswer } from "@careevolution/mydatahelps-js";
import add from "date-fns/add";
import { predictableRandomNumber } from "../../../helpers/predictableRandomNumber";
import { getDayKey } from "../../../helpers";

export default { title: "Container/SurveyAnswerChart", component: SurveyAnswerChart, parameters: { layout: 'fullscreen' } };
let render = (args: SurveyAnswerChartProps) => <Layout colorScheme="auto"><Card><SurveyAnswerChart {...args} /></Card></Layout>

async function generateSurveyResponse(date: Date, resultIdentifier: string, surveyName: string, rangeStart: number, rangeEnd: number): Promise<SurveyAnswer> {
var answer = await predictableRandomNumber(getDayKey(date)+resultIdentifier);
return {
"id": "00000000-0000-0000-0000-000000000000",
"surveyID": "00000000-0000-0000-0000-000000000000",
"surveyResultID": "00000000-0000-0000-0000-000000000000",
"surveyVersion": 0,
"surveyName": surveyName,
"surveyDisplayName": surveyName,
"date": date.toISOString(),
"stepIdentifier": resultIdentifier,
"resultIdentifier": resultIdentifier,
"answers": [
(answer % (rangeEnd - rangeStart) + rangeStart).toString()
],
"insertedDate": date.toISOString()
};
}
Comment on lines +12 to +29
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor generateSurveyResponse to avoid using string literals for keys.

-    return {
-        "id": "00000000-0000-0000-0000-000000000000",
-        "surveyID": "00000000-0000-0000-0000-000000000000",
-        "surveyResultID": "00000000-0000-0000-0000-000000000000",
-        "surveyVersion": 0,
-        "surveyName": surveyName,
-        "surveyDisplayName": surveyName,
-        "date": date.toISOString(),
-        "stepIdentifier": resultIdentifier,
-        "resultIdentifier": resultIdentifier,
-        "answers": [
-            (answer % (rangeEnd - rangeStart) + rangeStart).toString()
-        ],
-        "insertedDate": date.toISOString()
-    };
+    return {
+        id: "00000000-0000-0000-0000-000000000000",
+        surveyID: "00000000-0000-0000-0000-000000000000",
+        surveyResultID: "00000000-0000-0000-0000-000000000000",
+        surveyVersion: 0,
+        surveyName: surveyName,
+        surveyDisplayName: surveyName,
+        date: date.toISOString(),
+        stepIdentifier: resultIdentifier,
+        resultIdentifier: resultIdentifier,
+        answers: [
+            (answer % (rangeEnd - rangeStart) + rangeStart).toString()
+        ],
+        insertedDate: date.toISOString()
+    };
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
async function generateSurveyResponse(date: Date, resultIdentifier: string, surveyName: string, rangeStart: number, rangeEnd: number): Promise<SurveyAnswer> {
var answer = await predictableRandomNumber(getDayKey(date)+resultIdentifier);
return {
"id": "00000000-0000-0000-0000-000000000000",
"surveyID": "00000000-0000-0000-0000-000000000000",
"surveyResultID": "00000000-0000-0000-0000-000000000000",
"surveyVersion": 0,
"surveyName": surveyName,
"surveyDisplayName": surveyName,
"date": date.toISOString(),
"stepIdentifier": resultIdentifier,
"resultIdentifier": resultIdentifier,
"answers": [
(answer % (rangeEnd - rangeStart) + rangeStart).toString()
],
"insertedDate": date.toISOString()
};
}
async function generateSurveyResponse(date: Date, resultIdentifier: string, surveyName: string, rangeStart: number, rangeEnd: number): Promise<SurveyAnswer> {
var answer = await predictableRandomNumber(getDayKey(date)+resultIdentifier);
return {
id: "00000000-0000-0000-0000-000000000000",
surveyID: "00000000-0000-0000-0000-000000000000",
surveyResultID: "00000000-0000-0000-0000-000000000000",
surveyVersion: 0,
surveyName: surveyName,
surveyDisplayName: surveyName,
date: date.toISOString(),
stepIdentifier: resultIdentifier,
resultIdentifier: resultIdentifier,
answers: [
(answer % (rangeEnd - rangeStart) + rangeStart).toString()
],
insertedDate: date.toISOString()
};
}
Tools
Biome

[error] 15-15: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 16-16: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 17-17: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 18-18: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 19-19: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 20-20: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 21-21: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 22-22: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 23-23: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 24-24: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


[error] 27-27: The computed expression can be simplified without the use of a string literal. (lint/complexity/useLiteralKeys)

Unsafe fix: Use a literal key instead.


async function getRandomFFWELData(start: Date, end: Date) {
let creativeSelfResponses: (SurveyAnswer | null)[] = [];
let copingSelfResponses: (SurveyAnswer | null)[] = [];
let socialSelfResponses: (SurveyAnswer | null)[] = [];

let currentDate = new Date(start);
while (currentDate < end) {
creativeSelfResponses.push(await generateSurveyResponse(currentDate, "CreativeSelf", 'FFWEL', 10, 100));
socialSelfResponses.push(await generateSurveyResponse(currentDate, "SocialSelf", 'FFWEL', 10, 100));
copingSelfResponses.push(await generateSurveyResponse(currentDate, "CopingSelf", 'FFWEL', 10, 100));
currentDate = add(currentDate, { months: 1 });
}
function filterNull(arr: any[]) { return arr.filter((a: any) => !!a); }
ajmenca marked this conversation as resolved.
Show resolved Hide resolved
let standardData: SurveyAnswer[][] = [filterNull(creativeSelfResponses), filterNull(copingSelfResponses), filterNull(socialSelfResponses)];
return standardData;
}

async function getRandomPainData(start: Date, end: Date) {
var responses = [];
let currentDate = new Date(start);
while (currentDate < end) {
responses.push(await generateSurveyResponse(currentDate, "PainToday", 'Pain Survey', 0, 10));
currentDate = add(currentDate, { days: 1 });
}
let standardData: SurveyAnswer[][] = [responses];
return standardData;
}


export const ffwelLineChart = {
args: {
title: "FFWEL Responses Line Chart",
options: {
domainMin: 0,
connectNulls: true
},
intervalType: "6Month",
weekStartsOn: "6DaysAgo",
series: [{ color: "#e41a1c", dataKey: "Creative Self", surveyName: "FFWEL", stepIdentifier: "CreativeSelf", resultIdentifier: "CreativeSelf" },
{ color: "#377eb8", dataKey: "Coping Self", surveyName: "FFWEL", stepIdentifier: "CopingSelf", resultIdentifier: "CopingSelf" },
{ color: "#4daf4a", dataKey: "Social Self", surveyName: "FFWEL", stepIdentifier: "SocialSelf", resultIdentifier: "SocialSelf" }],
valueFormatter: (value: number) => Number(value.toFixed(0)).toLocaleString(),
chartType: "Line",
previewDataProvider: (start: Date, end: Date) => {
return Promise.resolve(getRandomFFWELData(start, end));
}
},
render: render
};

export const ffwelLineChartWithDataGap = {
args: {
title: "FFWEL Responses Line Chart",
options: {
domainMin: 0,
},
intervalType: "6Month",
weekStartsOn: "6DaysAgo",
series: [{ color: "#e41a1c", dataKey: "Creative Self", surveyName: "FFWEL", stepIdentifier: "CreativeSelf", resultIdentifier: "CreativeSelf" },
{ color: "#377eb8", dataKey: "Coping Self", surveyName: "FFWEL", stepIdentifier: "CopingSelf", resultIdentifier: "CopingSelf" },
{ color: "#4daf4a", dataKey: "Social Self", surveyName: "FFWEL", stepIdentifier: "SocialSelf", resultIdentifier: "SocialSelf" }],
valueFormatter: (value: number) => Number(value.toFixed(0)).toLocaleString(),
chartType: "Line",
expectedDataInterval: {months: 1},
previewDataProvider: async (start: Date, end: Date) => {
var data = await getRandomFFWELData(start,end);
data[0].splice(data[0].length/2,1);
data[1].splice(data[1].length/2,1);
data[2].splice(data[2].length/2,1);
return Promise.resolve(data);
}
Comment on lines +94 to +100
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle data gaps more efficiently in ffwelLineChartWithDataGap.

-            data[0].splice(data[0].length/2,1);
-            data[1].splice(data[1].length/2,1);
-            data[2].splice(data[2].length/2,1);
+            const midIndex = Math.floor(data[0].length / 2);
+            data.forEach(subArray => subArray.splice(midIndex, 1));
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
previewDataProvider: async (start: Date, end: Date) => {
var data = await getRandomFFWELData(start,end);
data[0].splice(data[0].length/2,1);
data[1].splice(data[1].length/2,1);
data[2].splice(data[2].length/2,1);
return Promise.resolve(data);
}
previewDataProvider: async (start: Date, end: Date) => {
var data = await getRandomFFWELData(start,end);
const midIndex = Math.floor(data[0].length / 2);
data.forEach(subArray => subArray.splice(midIndex, 1));
return Promise.resolve(data);
}

},
render: render
};

export const ffwelBarChart = {
args: {
title: "FFWEL Response Bar Chart",
options: {
domainMin: 0,
},
intervalType: "6Month",
weekStartsOn: "6DaysAgo",
series: [{ color: "#e41a1c", dataKey: "Creative Self", surveyName: "FFWEL", stepIdentifier: "CreativeSelf", resultIdentifier: "CreativeSelf" },
{ color: "#377eb8", dataKey: "Coping Self", surveyName: "FFWEL", stepIdentifier: "CopingSelf", resultIdentifier: "CopingSelf" },
{ color: "#4daf4a", dataKey: "Social Self", surveyName: "FFWEL", stepIdentifier: "SocialSelf", resultIdentifier: "SocialSelf" }],
valueFormatter: (value: number) => Number(value.toFixed(0)).toLocaleString(),
chartType: "Bar",
previewDataProvider: (start: Date, end: Date) => {
return Promise.resolve(getRandomFFWELData(start,end));
}
},
render: render
};

export const ffwelAreaChart = {
args: {
title: "FFWEL Response Area Chart",
options: {
domainMin: 0,
},
intervalType: "6Month",
weekStartsOn: "6DaysAgo",
series: [{ color: "#e41a1c", areaColor: '#d41a1c', dataKey: "Creative Self", surveyName: "FFWEL", stepIdentifier: "CreativeSelf", resultIdentifier: "CreativeSelf" },
{ color: "#377eb8", areaColor: '#277eb8', dataKey: "Coping Self", surveyName: "FFWEL", stepIdentifier: "CopingSelf", resultIdentifier: "CopingSelf" },
{ color: "#4daf4a", areaColor: '#3daf4a', dataKey: "Social Self", surveyName: "FFWEL", stepIdentifier: "SocialSelf", resultIdentifier: "SocialSelf" }],
valueFormatter: (value: number) => Number(value.toFixed(0)).toLocaleString(),
chartType: "Area",
previewDataProvider: (start: Date, end: Date) => {
return Promise.resolve(getRandomFFWELData(start,end));
}
},
render: render
};

export const ffwelLive = {
args: {
title: "FFWEL Live",
options: {
domainMin: 0,
lineColor: ["#e41a1c", "#377eb8", "#4daf4a"]
},
intervalType: "Week",
weekStartsOn: "6DaysAgo",
series: [{ color: "#e41a1c", dataKey: "Creative Self", surveyName: "FFWEL", stepIdentifier: "CreativeSelf", resultIdentifier: "CreativeSelf" },
{ color: "#377eb8", dataKey: "Coping Self", surveyName: "FFWEL", stepIdentifier: "CopingSelf", resultIdentifier: "CopingSelf" },
{ color: "#4daf4a", dataKey: "Social Self", surveyName: "FFWEL", stepIdentifier: "SocialSelf", resultIdentifier: "SocialSelf" }],
valueFormatter: (value: number) => Number(value.toFixed(0)).toLocaleString(),
chartType: "Line",
},
render: (args: SurveyAnswerChartProps) => <Layout colorScheme="auto"><Card><DateRangeCoordinator intervalType="6Month"><SurveyAnswerChart {...args} /></DateRangeCoordinator></Card></Layout>
};

export const dailyPainLineSurvey = {
args: {
title: "Daily Pain Line Survey",
options: {
domainMin: 0,
},
intervalType: "Week",
weekStartsOn: "6DaysAgo",
series: [{ dataKey: "Pain Level", surveyName: "Pain Survey", stepIdentifier: "PainToday", resultIdentifier: "PainToday" }],
valueFormatter: (value: number) => Number(value.toFixed(0)).toLocaleString(),
chartType: "Line",
previewDataProvider: (start: Date, end: Date) => {
return Promise.resolve(getRandomPainData(start,end));
}
},
render: render
};
export const dailyPainBarSurvey = {
args: {
title: "Daily Pain Bar Survey",
options: {
domainMin: 0,
},
intervalType: "Week",
weekStartsOn: "6DaysAgo",
series: [{ dataKey: "Pain Level", surveyName: "Pain Survey", stepIdentifier: "PainToday", resultIdentifier: "PainToday" }],
valueFormatter: (value: number) => Number(value.toFixed(0)).toLocaleString(),
chartType: "Bar",
previewDataProvider: (start: Date, end: Date) => {
return Promise.resolve(getRandomPainData(start,end));
}
},
render: render
};
export const dailyPainAreaSurvey = {
args: {
title: "Daily Pain Area Survey",
options: {
domainMin: 0,
},
intervalType: "Week",
weekStartsOn: "6DaysAgo",
series: [{ dataKey: "Pain Level", surveyName: "Pain Survey", stepIdentifier: "PainToday", resultIdentifier: "PainToday" }],
valueFormatter: (value: number) => Number(value.toFixed(0)).toLocaleString(),
chartType: "Area",
previewDataProvider: (start: Date, end: Date) => {
return Promise.resolve(getRandomPainData(start,end));
}
},
render: render
}
Loading