Răsfoiți Sursa

improve insights visibility

Daniel Bohry 9 luni în urmă
părinte
comite
51095bd1ac

+ 1 - 1
src/components/CurrentPositionChart.svelte

@@ -113,7 +113,7 @@
 							const data = dataset.data;
 							const data = dataset.data;
 							const total = data.reduce((sum, val) => sum + val, 0);
 							const total = data.reduce((sum, val) => sum + val, 0);
 							const percentage = total ? ((value / total) * 100).toFixed(2) : '0.00';
 							const percentage = total ? ((value / total) * 100).toFixed(2) : '0.00';
-							return `${formatCurrency(value, currency)} (${percentage}%)`;
+							return `${percentage}% (${formatCurrency(value, currency)})`;
 						}
 						}
 					}
 					}
 				},
 				},

+ 2 - 1
src/components/MarketDistributionChart.svelte

@@ -115,7 +115,8 @@
 					callbacks: {
 					callbacks: {
 						label: function(tooltipItem) {
 						label: function(tooltipItem) {
 							const value = tooltipItem.raw;
 							const value = tooltipItem.raw;
-							return `${formatCurrency(value, currency)}`;
+							const percentage = ((value / total) * 100).toFixed(2);
+							return `${percentage}% (${formatCurrency(value, currency)})`;
 						}
 						}
 					}
 					}
 				},
 				},