fix: select current IMGW Hybrid records
This commit is contained in:
@@ -6,6 +6,8 @@ import { useI18n } from "@/lib/i18n";
|
||||
import { formatForecastRainfall, formatForecastTemperature } from "@/lib/forecast-utils";
|
||||
import type { HourlyForecast } from "@/types/forecast";
|
||||
|
||||
const INITIAL_CHART_DIMENSION = { width: 1, height: 1 };
|
||||
|
||||
function formatHour(value: string) {
|
||||
return value.slice(11, 16);
|
||||
}
|
||||
@@ -25,8 +27,8 @@ export function DayForecastCharts({ hours }: { hours: HourlyForecast[] }) {
|
||||
<Card className="p-4 sm:p-5">
|
||||
<h3 className="text-sm font-semibold">{t("forecast.temperatureChart")}</h3>
|
||||
<p className="mt-1 text-xs leading-5 text-slate-600 dark:text-slate-300">{t("forecast.temperatureChartDescription")}</p>
|
||||
<div className="mt-4 h-56 w-full">
|
||||
<ResponsiveContainer width="100%" height="100%" minWidth={0}>
|
||||
<div className="mt-4 h-56 min-w-0">
|
||||
<ResponsiveContainer width="100%" height="100%" minWidth={0} minHeight={0} initialDimension={INITIAL_CHART_DIMENSION}>
|
||||
<ComposedChart data={rows} margin={{ left: -20, right: 8, top: 8 }}>
|
||||
<CartesianGrid stroke="rgba(148,163,184,0.18)" strokeDasharray="4 4" vertical={false} />
|
||||
<XAxis dataKey="time" axisLine={false} tickLine={false} interval={3} tick={{ fill: "currentColor", fontSize: 11 }} />
|
||||
@@ -46,8 +48,8 @@ export function DayForecastCharts({ hours }: { hours: HourlyForecast[] }) {
|
||||
<Card className="p-4 sm:p-5">
|
||||
<h3 className="text-sm font-semibold">{t("forecast.rainfallChart")}</h3>
|
||||
<p className="mt-1 text-xs leading-5 text-slate-600 dark:text-slate-300">{t("forecast.rainfallChartDescription")}</p>
|
||||
<div className="mt-4 h-56 w-full">
|
||||
<ResponsiveContainer width="100%" height="100%" minWidth={0}>
|
||||
<div className="mt-4 h-56 min-w-0">
|
||||
<ResponsiveContainer width="100%" height="100%" minWidth={0} minHeight={0} initialDimension={INITIAL_CHART_DIMENSION}>
|
||||
<ComposedChart data={rows} margin={{ left: -20, right: -10, top: 8 }}>
|
||||
<CartesianGrid stroke="rgba(148,163,184,0.18)" strokeDasharray="4 4" vertical={false} />
|
||||
<XAxis dataKey="time" axisLine={false} tickLine={false} interval={3} tick={{ fill: "currentColor", fontSize: 11 }} />
|
||||
|
||||
Reference in New Issue
Block a user