mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-09 06:29:47 +02:00
clarity
This commit is contained in:
parent
257dbecd1d
commit
afce57b29f
@ -58,9 +58,6 @@ export function DanswerBotChart({
|
|||||||
categories={["Total Queries", "Automatically Resolved"]}
|
categories={["Total Queries", "Automatically Resolved"]}
|
||||||
index="Day"
|
index="Day"
|
||||||
colors={["indigo", "fuchsia"]}
|
colors={["indigo", "fuchsia"]}
|
||||||
valueFormatter={(number: number) =>
|
|
||||||
`${Intl.NumberFormat("us").format(number).toString()}`
|
|
||||||
}
|
|
||||||
yAxisWidth={60}
|
yAxisWidth={60}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -56,9 +56,6 @@ export function FeedbackChart({
|
|||||||
categories={["Positive Feedback", "Negative Feedback"]}
|
categories={["Positive Feedback", "Negative Feedback"]}
|
||||||
index="Day"
|
index="Day"
|
||||||
colors={["indigo", "fuchsia"]}
|
colors={["indigo", "fuchsia"]}
|
||||||
valueFormatter={(number: number) =>
|
|
||||||
`${Intl.NumberFormat("us").format(number).toString()}`
|
|
||||||
}
|
|
||||||
yAxisWidth={60}
|
yAxisWidth={60}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -74,7 +74,7 @@ export function QueryPerformanceChart({
|
|||||||
categories={["Queries", "Unique Users"]}
|
categories={["Queries", "Unique Users"]}
|
||||||
index="Day"
|
index="Day"
|
||||||
colors={["indigo", "fuchsia"]}
|
colors={["indigo", "fuchsia"]}
|
||||||
valueFormatter={(number: number) =>
|
yAxisFormatter={(number: number) =>
|
||||||
new Intl.NumberFormat("en-US", {
|
new Intl.NumberFormat("en-US", {
|
||||||
notation: "standard",
|
notation: "standard",
|
||||||
maximumFractionDigits: 0,
|
maximumFractionDigits: 0,
|
||||||
@ -87,14 +87,6 @@ export function QueryPerformanceChart({
|
|||||||
day: "numeric",
|
day: "numeric",
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
tooltipFormatter={(dateStr: string) => {
|
|
||||||
const date = new Date(dateStr);
|
|
||||||
return date.toLocaleDateString("en-US", {
|
|
||||||
year: "numeric",
|
|
||||||
month: "short",
|
|
||||||
day: "numeric",
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
yAxisWidth={60}
|
yAxisWidth={60}
|
||||||
allowDecimals={false}
|
allowDecimals={false}
|
||||||
/>
|
/>
|
||||||
|
@ -24,7 +24,6 @@ interface AreaChartProps {
|
|||||||
categories?: string[];
|
categories?: string[];
|
||||||
index?: string;
|
index?: string;
|
||||||
colors?: string[];
|
colors?: string[];
|
||||||
valueFormatter?: (value: number) => string;
|
|
||||||
startEndOnly?: boolean;
|
startEndOnly?: boolean;
|
||||||
showXAxis?: boolean;
|
showXAxis?: boolean;
|
||||||
showYAxis?: boolean;
|
showYAxis?: boolean;
|
||||||
@ -42,7 +41,8 @@ interface AreaChartProps {
|
|||||||
className?: string;
|
className?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
xAxisFormatter?: (dateStr: string) => string;
|
xAxisFormatter?: (value: any) => string;
|
||||||
|
yAxisFormatter?: (value: any) => string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function AreaChartDisplay({
|
export function AreaChartDisplay({
|
||||||
@ -50,9 +50,6 @@ export function AreaChartDisplay({
|
|||||||
categories = [],
|
categories = [],
|
||||||
index,
|
index,
|
||||||
colors = ["indigo", "fuchsia"],
|
colors = ["indigo", "fuchsia"],
|
||||||
xAxisFormatter = (dateStr: string) => dateStr,
|
|
||||||
valueFormatter = (number: number) =>
|
|
||||||
`${Intl.NumberFormat("us").format(number).toString()}`,
|
|
||||||
startEndOnly = false,
|
startEndOnly = false,
|
||||||
showXAxis = true,
|
showXAxis = true,
|
||||||
showYAxis = true,
|
showYAxis = true,
|
||||||
@ -70,6 +67,8 @@ export function AreaChartDisplay({
|
|||||||
className,
|
className,
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
|
xAxisFormatter = (dateStr: string) => dateStr,
|
||||||
|
yAxisFormatter = (number: number) => number.toString(),
|
||||||
}: AreaChartProps) {
|
}: AreaChartProps) {
|
||||||
return (
|
return (
|
||||||
<Card className={className}>
|
<Card className={className}>
|
||||||
@ -104,7 +103,7 @@ export function AreaChartDisplay({
|
|||||||
width={yAxisWidth}
|
width={yAxisWidth}
|
||||||
tickLine={false}
|
tickLine={false}
|
||||||
axisLine={false}
|
axisLine={false}
|
||||||
tickFormatter={valueFormatter}
|
tickFormatter={(value) => yAxisFormatter(value)}
|
||||||
allowDecimals={allowDecimals}
|
allowDecimals={allowDecimals}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user