diff --git a/src/lib/components/PaymentHistoryChart.svelte b/src/lib/components/PaymentHistoryChart.svelte index eabf6e4..bdeab2a 100644 --- a/src/lib/components/PaymentHistoryChart.svelte +++ b/src/lib/components/PaymentHistoryChart.svelte @@ -71,131 +71,140 @@ } -
- {#if data.length === 0} -
- داده‌ای برای این بازه ثبت نشده است. -
- {:else} - - - - - - - - {#each [0, 1, 2, 3, 4] as row} - {@const y = pad.top + (row * (height - pad.top - pad.bottom)) / 4} + +
+
+ {#if data.length === 0} +
+ داده‌ای برای این بازه ثبت نشده است. +
+ {:else} + + + + + + + + {#each [0, 1, 2, 3, 4] as row} + {@const y = pad.top + (row * (height - pad.top - pad.bottom)) / 4} + + {formatValue(Math.round(max * (1 - row / 4)))} + {/each} + - {formatValue(Math.round(max * (1 - row / 4)))} - {/each} - - - {#each xTickIndexes as tickIndex} - {@const tick = positions[tickIndex]} - + {#each xTickIndexes as tickIndex} + {@const tick = positions[tickIndex]} + + {axisLabel(tick)} + {/each} {axisLabel(tick)}{periodType === 'DAY' ? 'ساعت' : 'تاریخ'} - {/each} - {periodType === 'DAY' ? 'ساعت' : 'تاریخ'} - تعداد پرداخت موفق - - - {#each positions as point, index} - تعداد پرداخت موفق + + (active = index)} - onmouseleave={() => (active = null)} - onfocus={() => (active = index)} - onblur={() => (active = null)} + stroke-linecap="round" + stroke-linejoin="round" + class="chart-line" /> - {/each} - - {#if active !== null && positions[active]} -
+ {#each positions as point, index} + (active = index)} + onmouseleave={() => (active = null)} + onfocus={() => (active = index)} + onblur={() => (active = null)} + /> + {/each} + + {#if active !== null && positions[active]}
- {fullPointLabel(positions[active])} - {formatValue(positions[active].bankPaidSessions)} پرداخت موفق - {formatMoney(positions[active].bankPaidAmountRial)} + {fullPointLabel(positions[active])} + {formatValue(positions[active].bankPaidSessions)} پرداخت موفق + {formatMoney(positions[active].bankPaidAmountRial)} +
-
+ {/if} {/if} - {/if} +