Opis
Upuść wiele TWeatherChart na formę. Serie (Title, Parameter, Color, punkty filled/hollow). Wymaga TWeather — sam Chart nie otwiera okna. Po kliku obszaru (Charts.ShowOnAreaClick) wykresy wypełniają panele okna prognozy (przesuwane w poziomie).
Moduł: MapCommon.Weather.Views · Klasa bazowa: TWeatherLinkedView · Platformy: VCL + FMX

Demo na żywo
Interaktywne demo HTML.
TWeather + Chart (+ HourStrip/DayItems) wypełniają okno prognozy.
▶ Klik obszaru → modal z wykresamiNakładka + ten sam modal.
▶ TWeather + Charts.ShowOnAreaClickFunkcje
- Series[]: Title (legenda), Parameter, ChartKind, Color, fill, LineWidth.
- Punkty: ShowPoints, PointRadius, PointColor, PointOpacity (0..1), PointStyle wpsFilled/wpsHollow.
- ShowLegend, ShowXTicks, ShowYTicks, X/YAxisCaption, X/YValueFormat.
- Shortcut Parameter/Color… synchronizuje Series[0].
- Style (caption/kolory/font) + Host ViewJSON.
Właściwości
| Właściwość | Opis |
|---|---|
| Series | Kolekcja serii (Title, Parameter, styl linii/punktów). |
| Parameter, ChartKind, Color, Fill* | Skrót do Series[0]. |
| ShowPoints, PointRadius, PointColor, PointOpacity, PointStyle | Markery: filled/hollow. |
| ShowLegend, ShowXTicks, ShowYTicks | Legenda i ticki osi. |
| XAxisCaption, YAxisCaption, XValueFormat, YValueFormat | Opisy i format liczb. |
| DayIndex, ShowGrid, Style, Weather | Zakres dnia; siatka; chrome; AutoLink. |
Zdarzenia
| Zdarzenie | Opis |
|---|---|
| OnViewChanged(ViewJSON) | series[] + axis options dla hosta Chart.js / własnego UI. |
Metody
| Metoda | Opis |
|---|---|
| ApplyJSON / ViewJSON / RefreshHost |
Przykłady
Wiele serii + legenda + punkty
// Klik obszaru → okno z Scene + dane + HourStrip / Chart
procedure TForm1.Areas1AreaClick(Sender: TObject; const Lat, Lon: Double;
const AreaName, Admin: string);
begin
Weather1.Area.Kind := wakPoints;
Weather1.Area.Points.Text := Format('%.4f,%.4f', [Lat, Lon], WeatherInvariantFS);
Weather1.ForecastKind := wfkHourly;
FPopupAreaName := AreaName;
Weather1.Request; // middleware — UI family dostaje OnDataReady przez RegisterLinkedView
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Weather1.ApiKey := GetEnvironmentVariable('WEATHER_API_KEY');
WeatherScene1.Weather := Weather1; // AutoLink też OK
WeatherScene1.Labels.Caption := 'Warszawa 25°C';
WeatherScene1.Host := PanelSky;
HourStrip1.Weather := Weather1;
HourStrip1.Style.Caption := 'Godziny';
HourStrip1.Style.FontSize := 12;
HourStrip1.UseCustomIcons := False; // True + CustomIcons = własne PNG
DayItems1.Weather := Weather1;
DayItems1.MaxDays := 7;
// Wiele serii na jednej osi + legenda / ticki / format
Chart1.Weather := Weather1;
Chart1.ShowLegend := True;
Chart1.ShowXTicks := True;
Chart1.ShowYTicks := True;
Chart1.XAxisCaption := 'Czas';
Chart1.YAxisCaption := '°C / %';
Chart1.YValueFormat := '0.0';
Chart1.Series.Clear;
with Chart1.Series.Add do begin
Title := 'Temperatura'; Parameter := wpTemperature2m;
Color := '#ff9800'; ChartKind := wckLine;
ShowPoints := True; PointStyle := wpsFilled; PointOpacity := 0.9;
end;
with Chart1.Series.Add do begin
Title := 'Wilgotność'; Parameter := wpRelativeHumidity2m;
Color := '#4fc3f7'; ChartKind := wckLine;
ShowPoints := True; PointStyle := wpsHollow; PointColor := '#0288d1';
end;
end;Pełna lista API
Generowana z deklaracji w kodzie (Source/*.pas): wszystkie opublikowane właściwości i zdarzenia TWeatherChart (także dziedziczone), właściwości publiczne i metody publiczne.
Właściwości opublikowane (28)
| Właściwość | Typ | Domyślnie | Opis |
|---|---|---|---|
Weather | TWeather | ||
Host | TComponent | ||
AutoLinkComponents | Boolean | True | Automatycznie łącz pierwszy dostawcę wyszukiwania / TMapAreas / TEditMap z formy |
Active | Boolean | True | |
UseCustomIcons | Boolean | False | |
CustomIcons | TStrings | ||
Style | TWeatherViewStyle | Styl mapy (enum): kafle OSM / satelita / teren / własne (TTileMap*) lub styl wektorowy (T3DMap*) | |
Series | TWeatherChartSeriesCollection | ||
Parameter | TWeatherParam | wpTemperature2m | |
ChartKind | TWeatherChartKind | wckLine | |
Color | string | Standardowa właściwość kontrolki VCL | |
FillUnderLine | Boolean | True | |
FillColor | string | ||
LineWidth | Double | ||
ShowPoints | Boolean | False | |
PointRadius | Double | ||
PointColor | string | ||
PointOpacity | Double | ||
PointStyle | TWeatherPointStyle | wpsFilled | |
DayIndex | Integer | -1 | |
ShowGrid | Boolean | True | |
ShowLegend | Boolean | True | |
ShowXTicks | Boolean | True | |
ShowYTicks | Boolean | True | |
XAxisCaption | string | ||
YAxisCaption | string | ||
XValueFormat | string | ||
YValueFormat | string |
Zdarzenia (1)
| Zdarzenie | Typ | Opis |
|---|---|---|
OnViewChanged | TWeatherViewEvent |
Właściwości publiczne – tylko w kodzie (1)
| Właściwość | Typ | Opis |
|---|---|---|
LastViewJSON | string |
Metody publiczne (7)
| Metoda | Opis |
|---|---|
procedure ApplyJSON(const JSON: string) | |
procedure ApplyFromWeather | |
procedure Clear | Usuwa własne pliki |
procedure RefreshHost | |
function ViewJSON: string | |
procedure DetectLinkedComponents | Wyszukuje na formie i łączy dostawcę / TMapAreas / TEditMap |
procedure SeriesNotify |
Pełny opis wszystkich właściwości: dokumentacja komponentów map.
Zobacz też
TWeather
Pogoda na mapie: ikony i temperatura na obszarach (skórki iOS glass / Android / custom); JSON z weather.imetroll.com (current / godzinowo / 7 dni).
TWeatherHourStrip
Pasek godzinowy prognozy (ikony WMO + temperatura). Wypełnia okno po danych z TWeather.
TWeatherDayItems
Prognoza 7 dni w kafelkach (ikona, min/max, opady). Część okna TWeatherPopup.