Skip to content

Commit ed29602

Browse files
committed
fix legend
1 parent 7a72025 commit ed29602

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

dashboard/ai-analytics/src/app/components/SparkChart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ import { useState } from 'react';
103103
showAnimation={false}
104104
curveType="monotone"
105105
stack={isStacked}
106+
yAxisWidth={60}
106107
customTooltip={(props) => (
107108
<div style={{
108109
position: 'fixed',

dashboard/ai-analytics/src/app/components/TimeseriesChart.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ export default function TimeseriesChart({ data, filters, onFiltersChange, isLoad
210210
return `$${valueFormatter(number)}`;
211211
}
212212
};
213+
214+
// Add a separate formatter for the y-axis with fewer decimal places
215+
const yAxisValueFormatter = (number: number) => {
216+
// Use fewer decimal places for the y-axis to prevent cutting off
217+
return `$${number.toFixed(2)}`;
218+
};
213219

214220
return (
215221
<Card
@@ -291,7 +297,7 @@ export default function TimeseriesChart({ data, filters, onFiltersChange, isLoad
291297
colors={tab.colors}
292298
stack={true}
293299
showLegend={false}
294-
yAxisWidth={45}
300+
yAxisWidth={60}
295301
valueFormatter={costValueFormatter}
296302
className="h-[calc(100%-24px)] mt-10 hidden md:block"
297303
showTooltip={true}

0 commit comments

Comments
 (0)