|
|
|
@ -231,7 +231,7 @@ const Chart: React.FC<IChartProps> = ({
|
|
|
|
const sumData = isAvg ? (sum(yData) / yData.length) : sum(yData)
|
|
|
|
const sumData = isAvg ? (sum(yData) / yData.length) : sum(yData)
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className={`flex flex-col w-full px-6 py-4 border-[0.5px] rounded-lg border-gray-200 shadow-xs ${className ?? ''}`}>
|
|
|
|
<div className={`flex flex-col w-full px-6 py-4 rounded-xl bg-components-chart-bg shadow-xs ${className ?? ''}`}>
|
|
|
|
<div className='mb-3'>
|
|
|
|
<div className='mb-3'>
|
|
|
|
<Basic name={title} type={timePeriod} hoverTip={explanation} />
|
|
|
|
<Basic name={title} type={timePeriod} hoverTip={explanation} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -242,11 +242,11 @@ const Chart: React.FC<IChartProps> = ({
|
|
|
|
type={!CHART_TYPE_CONFIG[chartType].showTokens
|
|
|
|
type={!CHART_TYPE_CONFIG[chartType].showTokens
|
|
|
|
? ''
|
|
|
|
? ''
|
|
|
|
: <span>{t('appOverview.analysis.tokenUsage.consumed')} Tokens<span className='text-sm'>
|
|
|
|
: <span>{t('appOverview.analysis.tokenUsage.consumed')} Tokens<span className='text-sm'>
|
|
|
|
<span className='ml-1 text-gray-500'>(</span>
|
|
|
|
<span className='ml-1 text-text-tertiary'>(</span>
|
|
|
|
<span className='text-orange-400'>~{sum(statistics.map(item => Number.parseFloat(get(item, 'total_price', '0')))).toLocaleString('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 4 })}</span>
|
|
|
|
<span className='text-orange-400'>~{sum(statistics.map(item => Number.parseFloat(get(item, 'total_price', '0')))).toLocaleString('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 4 })}</span>
|
|
|
|
<span className='text-gray-500'>)</span>
|
|
|
|
<span className='text-text-tertiary'>)</span>
|
|
|
|
</span></span>}
|
|
|
|
</span></span>}
|
|
|
|
textStyle={{ main: `!text-3xl !font-normal ${sumData === 0 ? '!text-gray-300' : ''}` }} />
|
|
|
|
textStyle={{ main: `!text-3xl !font-normal ${sumData === 0 ? '!text-text-quaternary' : ''}` }} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<ReactECharts option={options} style={{ height: 160 }} />
|
|
|
|
<ReactECharts option={options} style={{ height: 160 }} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|