graph fix

This commit is contained in:
suryac 2026-08-07 16:09:02 +05:30
parent db565842f3
commit bcb659c570

View File

@ -133,11 +133,13 @@ export function AnalyticsChart({ data, gridCols }: AnalyticsChartProps) {
tickLine={false} tickLine={false}
tick={{ fontSize: 12, fill: '#64748B' }} tick={{ fontSize: 12, fill: '#64748B' }}
allowDecimals={false} allowDecimals={false}
width={80}
/> />
<Tooltip <Tooltip
cursor={{ fill: '#F8FAFC', stroke: '#E2E8F0', strokeWidth: 1, strokeDasharray: '3 3' }} cursor={{ fill: '#F8FAFC', stroke: '#E2E8F0', strokeWidth: 1, strokeDasharray: '3 3' }}
contentStyle={{ borderRadius: '8px', border: '1px solid #E2E8F0', boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1)', fontSize: '14px', fontFamily: 'inherit' }} contentStyle={{ borderRadius: '8px', border: '1px solid #E2E8F0', boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1)', fontSize: '14px', fontFamily: 'inherit' }}
labelStyle={{ fontWeight: 'bold', color: '#0F172A', marginBottom: '4px' }} labelStyle={{ fontWeight: 'bold', color: '#0F172A', marginBottom: '4px' }}
wrapperStyle={{ zIndex: 1000 }}
/> />
{hasSeries && <Legend wrapperStyle={{ paddingTop: '20px' }} />} {hasSeries && <Legend wrapperStyle={{ paddingTop: '20px' }} />}
{seriesKeys.map((key, i) => { {seriesKeys.map((key, i) => {
@ -220,6 +222,7 @@ export function AnalyticsChart({ data, gridCols }: AnalyticsChartProps) {
<Tooltip <Tooltip
contentStyle={{ borderRadius: '8px', border: '1px solid #E2E8F0', boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1)', fontSize: '14px', fontFamily: 'inherit' }} contentStyle={{ borderRadius: '8px', border: '1px solid #E2E8F0', boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1)', fontSize: '14px', fontFamily: 'inherit' }}
itemStyle={{ color: '#0F172A', fontWeight: '500' }} itemStyle={{ color: '#0F172A', fontWeight: '500' }}
wrapperStyle={{ zIndex: 1000 }}
/> />
<Legend wrapperStyle={{ paddingTop: '20px' }} /> <Legend wrapperStyle={{ paddingTop: '20px' }} />
<Pie <Pie
@ -240,15 +243,15 @@ export function AnalyticsChart({ data, gridCols }: AnalyticsChartProps) {
</Pie> </Pie>
</PieChart> </PieChart>
) : chartType === 1 ? ( ) : chartType === 1 ? (
<LineChart data={finalData} margin={{ top: 10, right: 10, left: -20, bottom: 0 }} className="focus:outline-none outline-none" style={{ outline: 'none' }}> <LineChart data={finalData} margin={{ top: 10, right: 10, left: 0, bottom: 10 }} className="focus:outline-none outline-none" style={{ outline: 'none' }}>
{renderChartContent()} {renderChartContent()}
</LineChart> </LineChart>
) : chartType === 2 ? ( ) : chartType === 2 ? (
<AreaChart data={finalData} margin={{ top: 10, right: 10, left: -20, bottom: 0 }} className="focus:outline-none outline-none" style={{ outline: 'none' }}> <AreaChart data={finalData} margin={{ top: 10, right: 10, left: 0, bottom: 10 }} className="focus:outline-none outline-none" style={{ outline: 'none' }}>
{renderChartContent()} {renderChartContent()}
</AreaChart> </AreaChart>
) : ( ) : (
<BarChart data={finalData} margin={{ top: 10, right: 10, left: -20, bottom: 0 }} className="focus:outline-none outline-none" style={{ outline: 'none' }}> <BarChart data={finalData} margin={{ top: 10, right: 10, left: 0, bottom: 10 }} className="focus:outline-none outline-none" style={{ outline: 'none' }}>
{renderChartContent()} {renderChartContent()}
</BarChart> </BarChart>
)} )}