diff --git a/web/src/components/dashboard/BarChart.jsx b/web/src/components/dashboard/BarChart.jsx new file mode 100644 index 0000000..ca3c1cc --- /dev/null +++ b/web/src/components/dashboard/BarChart.jsx @@ -0,0 +1,43 @@ +import React from 'react'; + +const BarChart = ({ data = [], width = 400, height = 80, color = 'currentColor' }) => { + if (!data || data.length === 0) return null; + + const max = Math.max(...data, 1); + const barCount = data.length; + const gap = 4; + const totalGap = (barCount - 1) * gap; + const barWidth = Math.max(8, (width - totalGap) / barCount); + const totalUsed = barCount * barWidth + totalGap; + const offsetX = (width - totalUsed) / 2; + + return ( + + ); +}; + +export default BarChart; diff --git a/web/src/components/dashboard/BentoTrend.jsx b/web/src/components/dashboard/BentoTrend.jsx index ae8f3ad..666198f 100644 --- a/web/src/components/dashboard/BentoTrend.jsx +++ b/web/src/components/dashboard/BentoTrend.jsx @@ -19,7 +19,7 @@ For commercial licensing, please contact support@quantumnous.com import React, { useMemo, useState, useRef, useEffect } from 'react'; import { TrendingUp, RefreshCw, ChevronDown } from 'lucide-react'; -import Sparkline from './Sparkline'; +import BarChart from './BarChart'; import { renderQuota } from '../../helpers'; const formatMD = (d) => { @@ -224,7 +224,7 @@ const BentoTrend = ({