Explorar el Código

adjust stock history price chart

Daniel Bohry hace 7 meses
padre
commit
caaea9dab3
Se han modificado 1 ficheros con 6 adiciones y 19 borrados
  1. 6 19
      src/components/StockPriceHistory.svelte

+ 6 - 19
src/components/StockPriceHistory.svelte

@@ -91,29 +91,16 @@
 								const idx = context[0].dataIndex;
 								const raw = data[idx];
 								const dt = new Date(raw.createdAt);
-								return dt.toLocaleString('en-GB', {
-									day: '2-digit',
-									month: '2-digit',
-									year: 'numeric',
-									hour: '2-digit',
-									minute: '2-digit',
-									second: '2-digit',
-									hour12: false
-								});
+								const dd = String(dt.getDate()).padStart(2, '0');
+								const mm = String(dt.getMonth() + 1).padStart(2, '0');
+								const yyyy = dt.getFullYear();
+								return `${dd}/${mm}/${yyyy}`;
 							},
-							label: (context) => {
-								return `Price: ${context.parsed.y.toFixed(2)}`;
-							}
+							label: (context) => context.parsed.y.toFixed(2)
 						}
 					},
 					datalabels: {
-						color: '#fff',
-						anchor: 'end',
-						align: 'top',
-						font: {
-							weight: 'bold'
-						},
-						formatter: (value) => value.toFixed(2)
+						display: false
 					}
 				}
 			}