Fix YAxis Merval - Comment run worker ejecution
This commit is contained in:
		| @@ -40,7 +40,7 @@ export const HistoricalChartWidget = ({ ticker, mercado, dias }: HistoricalChart | |||||||
|             <LineChart data={data} margin={{ top: 5, right: 30, left: 20, bottom: 5 }}> |             <LineChart data={data} margin={{ top: 5, right: 30, left: 20, bottom: 5 }}> | ||||||
|                 <CartesianGrid strokeDasharray="3 3" /> |                 <CartesianGrid strokeDasharray="3 3" /> | ||||||
|                 <XAxis dataKey="fechaRegistro" tickFormatter={formatXAxis} /> |                 <XAxis dataKey="fechaRegistro" tickFormatter={formatXAxis} /> | ||||||
|                 <YAxis domain={['dataMin - 1', 'dataMax + 1']} tickFormatter={(tick) => `$${tick.toLocaleString('es-AR')}`} /> |                 <YAxis domain={['dataMin - dataMin * 0.02', 'dataMax + dataMax * 0.02']} tickFormatter={(tick) => `$${tick.toLocaleString('es-AR')}`} /> | ||||||
|                 <Tooltip  |                 <Tooltip  | ||||||
|                     formatter={(value: number) => [`$${value.toFixed(2)}`, 'Precio']}  |                     formatter={(value: number) => [`$${value.toFixed(2)}`, 'Precio']}  | ||||||
|                     labelFormatter={formatTooltipLabel}  |                     labelFormatter={formatTooltipLabel}  | ||||||
|   | |||||||
| @@ -5,11 +5,10 @@ import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward'; | |||||||
| import RemoveIcon from '@mui/icons-material/Remove'; | import RemoveIcon from '@mui/icons-material/Remove'; | ||||||
|  |  | ||||||
| import type { CotizacionBolsa } from '../models/mercadoModels'; | import type { CotizacionBolsa } from '../models/mercadoModels'; | ||||||
| import { formatInteger, formatCurrency } from '../utils/formatters'; // <-- CORREGIDO: necesitamos formatCurrency | import { formatInteger, formatCurrency } from '../utils/formatters'; | ||||||
| import { HistoricalChartWidget } from './HistoricalChartWidget'; | import { HistoricalChartWidget } from './HistoricalChartWidget'; | ||||||
| import { useApiData } from '../hooks/useApiData'; | import { useApiData } from '../hooks/useApiData'; | ||||||
|  |  | ||||||
| // --- V SUB-COMPONENTE AÑADIDO V --- |  | ||||||
| const VariacionMerval = ({ actual, anterior }: { actual: number, anterior: number }) => { | const VariacionMerval = ({ actual, anterior }: { actual: number, anterior: number }) => { | ||||||
|     if (anterior === 0) return null; // Evitar división por cero |     if (anterior === 0) return null; // Evitar división por cero | ||||||
|     const variacionPuntos = actual - anterior; |     const variacionPuntos = actual - anterior; | ||||||
| @@ -34,7 +33,6 @@ const VariacionMerval = ({ actual, anterior }: { actual: number, anterior: numbe | |||||||
|         </Box> |         </Box> | ||||||
|     ); |     ); | ||||||
| }; | }; | ||||||
| // --- ^ SUB-COMPONENTE AÑADIDO ^ --- |  | ||||||
|  |  | ||||||
| export const MervalHeroCard = () => { | export const MervalHeroCard = () => { | ||||||
|     const { data: allLocalData, loading, error } = useApiData<CotizacionBolsa[]>('/mercados/bolsa/local'); |     const { data: allLocalData, loading, error } = useApiData<CotizacionBolsa[]>('/mercados/bolsa/local'); | ||||||
| @@ -58,7 +56,6 @@ export const MervalHeroCard = () => { | |||||||
|                     <Typography variant="h3" component="p" sx={{ fontWeight: 'bold', mt:1 }}>{formatInteger(mervalData.precioActual)}</Typography> |                     <Typography variant="h3" component="p" sx={{ fontWeight: 'bold', mt:1 }}>{formatInteger(mervalData.precioActual)}</Typography> | ||||||
|                 </Box> |                 </Box> | ||||||
|                 <Box sx={{ pt: 2 }}> |                 <Box sx={{ pt: 2 }}> | ||||||
|                     {/* Ahora sí encontrará el componente */} |  | ||||||
|                     <VariacionMerval actual={mervalData.precioActual} anterior={mervalData.cierreAnterior} /> |                     <VariacionMerval actual={mervalData.precioActual} anterior={mervalData.cierreAnterior} /> | ||||||
|                 </Box> |                 </Box> | ||||||
|             </Box> |             </Box> | ||||||
|   | |||||||
| @@ -65,7 +65,7 @@ namespace Mercados.Worker | |||||||
|             _logger.LogInformation("🚀 Servicio de Fetching iniciado a las: {time}", DateTimeOffset.Now); |             _logger.LogInformation("🚀 Servicio de Fetching iniciado a las: {time}", DateTimeOffset.Now); | ||||||
|  |  | ||||||
|             // Ejecutamos una vez al inicio para tener datos frescos inmediatamente. |             // Ejecutamos una vez al inicio para tener datos frescos inmediatamente. | ||||||
|             await RunAllFetchersAsync(stoppingToken); |             //await RunAllFetchersAsync(stoppingToken); | ||||||
|  |  | ||||||
|             // Calculamos las primeras ejecuciones programadas al arrancar. |             // Calculamos las primeras ejecuciones programadas al arrancar. | ||||||
|             var utcNow = DateTime.UtcNow; |             var utcNow = DateTime.UtcNow; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user